Skip to content

Conversation

@simonsmith
Copy link

Based on the fix discovered by @patheticGeek in this discussion I've applied the same one here.

Running the test project in this comment now works as expected

fixes #21

@simonsmith
Copy link
Author

I've had a bit more a play with this, and I think this package needs more love in general to support Astro 5. So could be worth addressing that to begin with

@NikitaIT
Copy link

NikitaIT commented Jun 12, 2025

Fastify should be "pre-middleware", not "post-middleware".

It breaks rest api design in general. This no longer works:

fastify.post('/login', () => 'fastify')
await fetch("http://localhost:4321/login", { method: "GET" }).then(x => x.text()) // .astro
await fetch("http://localhost:4321/login", { method: "POST" }).then(x => x.text()) // fastify

Because .astro matches only by URI, and fastify matches by any HTTP.

Maybe there is another solution.

Btw, it looks like code transformer / module resolution problem, so if it needs to be fixed by middleware reordering it most likely needs to be fixed in Vite or there should be the way to say "do after transform" or smth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue importing local TS files from entry

2 participants