-
Notifications
You must be signed in to change notification settings - Fork 375
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
[Bug]: Cloudflare-pages preset not working with Beta 2 #1217
Comments
Let me know if this helps. Two issues here: 1. Should be the same problem as nksaraf/vinxi#77Use overrides so you don't get two versions of vinxi. Workaround until new version of solid-start is published. {
...
"engines": {
"node": ">=18"
},
"overrides": {
"vinxi": "0.0.64"
}
} 2. Preset configTaken from the start docs source export default defineConfig({
start: {
server: {
preset: "cloudflare-pages",
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"]
},
}
}
}); Not a cloudflare user myself... maybe __STATIC_CONTENT_MANIFEST is not required not sure... Tested it with:
|
It's because of Async Local Storage. They support it with Node compat flag but unenv won't not patch it by default because that flag isn't default. I know |
@edivados Thanks a bunch your suggested solution does the job 😄 👍 ❤️ PS:
Any ETA on this? |
Using workers for applications (so in nitro the So I think that making sure that this works with Pages (the Thankfully requiring users to add the rollupConfig: {
external: ["node:async_hooks"]
}, code doesn't look too too bad to me (especially since we can do that for the in C3) |
@dario-piotrowicz Vinxi version should be fixed in @solidjs/start 0.4.3 which I released yesterday. I'm glad to hear this is all working. |
@ryansolid Thanks a bunch, I just tried it and it works 🙂 I'm also nice to see the config types improved 🤩 There is however a last small issue I think 😅 That's related to the new types (a bit unrelated to this gh issue), is It doesn't really seem to be since the following seems to be working totally fine: Also notice the lack of the:
so... it seems like that's actually no longer needed? 😮 |
I did a partial polyfill. It is imperfect. I suggest keeping that there. Technically if you grab the request at any synchronous entry to your code it works but we need async local storage to support async grabbing of the event. You might not need it in your case, but it may come up again later. |
I think we are good now with 0.4.5 fixing the config? |
@ryansolid sorry for the late reply 🙇 Yes I think we're good! 🙂 But before we close this issue I'd like to ask, if setting the |
Hmm.. I don't usually write custom stuff like that but yeah maybe I can do it in our config. We don't own the presets Nitro does. I could think of looking at the preset setting, although it can also be set via ENV variable. If we check both and see "cloudflare-pages" or "cloudflare-modules" maybe we could automatically add the right stuff. Although is there a way to make it so node compat is always turned on for SolidStart apps? |
Hey @ryansolid, I'm sorry unfortunately currently there isn't any way to always turn on The team is currently looking into introducing a config file for Pages, once that is supported solid could just set the PS: this is an issue I've discussed with the Nitro team as well (cc. @pi0) maybe it'd be worth to sync up and discuss things together? |
Ok I've created a new issue to track the config automation and closing this one. Yeah we all share a common goal here so we should meet up. |
Duplicates
Latest version
Current behavior 😯
It seems that trying to build a solid-start application using vinxi generates a broken non-deployable output
From the terminal logs I think that the fetch handler might be omitted from the build output:
Expected behavior 🤔
npm run build
should produce a functioning Cloudflare Pages applicationSteps to reproduce 🕹
Steps:
cloudflare-pages
preset in yourvite.config.ts
(docs):run
npm run build
, notice in the terminal that the correct preset gets picked up:run
npx wrangler pages dev dist/
to see the following error in the terminal:Minimal Reproduction
In case it helps I've created a minimal reproduction for this: https://github.com/dario-piotrowicz/solid-start-beta-2-cloudflare-pages-preset-build-not-working-repro
The text was updated successfully, but these errors were encountered: