-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: module.page is not a function
when using rewrites
#12336
Comments
The issue isn't caused by the rewrite. Removing |
Container.astro is unchanged from the SSR starter template. The error is in fact from the rewrite as the stack trace shows. |
I see something completely different from your stackblitz
|
Might have to do with stackblitz. |
I also downloaded the reproduction (at the very beginning), and removing the rewrite doesn't have any effect. I still see the error. |
Does it say which fetch? build-time/runtime? |
Hello @lilnasy. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
The repro is built by making just a few changes to the SSR starter template. Does it not qualify as minimal? |
I can't reproduce the error 😞 I don't want to close the issue, but we need a reproduction where I can see your same error. |
I mean you are free to let other maintainers tackle it if you can't, but needs repro is not the tag to go with, is it? video.mp4 |
It wasn't clear that I had to use the
Please refrain from making these kinds of comments, I am trying my best, and it happens if I make mistakes |
Sorry. It doesn't come across over github comments, but I didn't mean to be rude. Just meant to point out that other maintainers wouldn't try to triage an issue already tagged with needs repro. |
It seems that the issue is that // Contents removed by Astro as it's used for prerendering only Making the page not prerendered works. I believe this behaviour is intended. I suppose it's also a difficult way to reproduce the intended behaviour in development |
Is that a documented limitation of rewrites? |
Probably not, however I don't think it shouldn't be possible to use Did you try to use I'll have to see if it will be able to emit an error/warning for these cases in dev mode. |
It's the same error with |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When the target of a rewrite resolves to a prerendered page, the request fails, responding with a blank 500 page.
What's the expected result?
Middleware successfully rewrites to a prerendered page.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-1oeqxb?file=src%2Fmiddleware.ts
Participation
The text was updated successfully, but these errors were encountered: