Skip to content

Astro v5 + Fastify v5 update #39

@NikitaFedorov1

Description

@NikitaFedorov1

I did:

"peerDependencies": {
		"astro": "^1.1.3 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
	},
	"dependencies": {
		"@astrojs/webapi": "^2.2.0",
		"@fastify/static": "^8.2.0",
		"fastify": "^5.4.0"
	},
	"devDependencies": {
		"astro": "^5.9.2"
	}

With astro build i get:

FastifyError: COPY method is not supported.
FastifyError {
  code: "FST_ERR_ROUTE_METHOD_NOT_SUPPORTED",
  name: "FastifyError",
  statusCode: 500,
  message: "COPY method is not supported.",

Solution was to add:

export function start(manifest, options) {
	const app = new NodeApp(manifest);

	const fastify = Fastify({
		logger: options.logger ?? true,
	});
+[
+			"COPY",
+			"MOVE",
+			"LOCK",
+			"MKCOL",
+			"UNLOCK",
+			"SEARCH",
+			"PROPFIND",
+			"PROPPATCH",
+].forEach((method) => {
+    fastify.addHttpMethod(method);
+  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions