enhance-dev / fastify-plugin

Build your Fastify app's views with custom elements. Powered by Enhance
https://enhance.dev/docs/learn/deployment/fastify
3 stars 0 forks source link

Existing API route resolves to 404 #4

Open sdussaut opened 1 year ago

sdussaut commented 1 year ago

Hi! If I use the fastify-plugin, in some cases API routes resolve to a 404 while the route exists.

If the route is called before rendering a page (example: browsing to / and having a /api/index.mjs route), it works fine.

It seems to fail when used to post something from a form (like in the form counter example from the docs) and subsequently also fails if the route is called directly from xhr.

Everything works fine when I use arc sandbox.