Closed varialweb closed 3 months ago
Also I tried to get this working in StackBlitz, but the API routes wont work at all for me in there, so in order to reproduce this, you may have to create it locally on your machine.
Also I tried to get this working in StackBlitz, but the API routes wont work at all for me in there, so in order to reproduce this, you may have to create it locally on your machine.
So just downloading the stackblitz repository is enough?
That is pretty odd, will take a look.
Where do you get that error message? I just tried and it built cleanly. Dev also appears to work fine.
Where do you get that error message? I just tried and it built cleanly. Dev also appears to work fine.
In the min reproduction @varialweb gave, just delete the ;
of export const prerender = false;
in /src/pages/api/contact.js
. And you will get the same error.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
If you have the project configured to hybrid rendering, and your API route uses javascript and you set
export const prerender = false
it will throw the error:It does not throw this error if you change the file to typescript.
What's the expected result?
I would expect the prerender const to work properly regardless of using typescript or javascript.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/withastro-astro-7ycbzn?file=src%2Fcomponents%2FContactForm.svelte
Participation