-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
test for bug reproduction #10738
test for bug reproduction #10738
Conversation
|
I looked into this in the past couple days, and I think it's hard to fix this. I've tried:
At the end, both approaches aren't perfect either, and I'm not sure if it's worth making them work. I think the more proper solution for now is to:
In the future, an even proper solution would be to run two rollup builds: SSG/prerendered pages and SSR/dynamic pages. It would be tricky to do that now because:
|
Thanks @bluwy for looking into this. I do agree with your outcome since I discovered something similar. I like both ideas, not using the prerender chunk noop flow and having two builds. Do you think it would be possible to add those workarounds now (4.11 maybe) and then come back to this with vite 6 and environment api? I also tried adding a flag, but not super happy, but it kinda allows for two builds: #11155 What do you think about that? |
Also very interested how @matthewp thinks about this, and which approach he would like to go, I just really think we should find a solution now and then look at a long term fix later :) |
I'd be fine with getting rid of the noop for now and thinking about another build later. There's a chance we'll need another build when we do server islands (although i hope not) so i could see changing how it works then. |
I think we can definitely do what's described at The two builds idea is something we would/could do far in the future though, so not something we should do now but can think about. |
Sounds great for me. If you're trying to do Step 1-3 next week, I'll be around and be able to test a preview release with the Cloudflare adapter to see if works :) ❤️ |
Test is included in #11245. Thanks for the test! |
@matthewp this adds a test to reproduce the issue:
pnpm i && pnpm run build
node --test "packages/astro/test/ssr-prerender-chunk.test.js"
packages/astro/test/fixtures/ssr-prerender-chunks/dist/_worker.js/renderers.mjs
import { r as reactExports, R as React } from './chunks/prerender_dvgq6Avf.mjs';
packages/astro/test/fixtures/ssr-prerender-chunks/dist/_worker.js/chunks/prerender_dvgq6Avf.mjs
noop
contentIt is not possible to test this with the exisiting
testAdapter
, since that relies onfs
and also doesn't use a realserverEntrypoint
but a Vite virtual import. I expect this is an issue withmanualChunks
settings of Astro core, but it might could be also an issue with some settings for theserverless-test-adapter
. Still I'm very lost and would love to get help & or a fix!(Maybe @bluwy has also an idea 🤔)
As my debugging goes the following issues are downstream issues caused by this: