-
-
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
SolidJS integration breaks app when used in Vercel Edge #5915
Comments
I ran into the same thing with Preact just now. |
Thanks for reporting! Wouldn't be the first component issue on Vercel edge. @pilcrowonpaper @jmn have either of you been able to repro with Astro 2.0? |
Yes. I'm on Astro 2.0 |
I ran into the same thing, not using any specific UI framework/library (only .astro) and deployed on Cloudflare pages |
I narrowed it down to the
|
@pilcrowonpaper is there a way to test vercel edge runtime locally? |
@AirBorne04 I don't think so. I know it's based on Cloudflare workers but I'm not sure if there's a way to run that locally as well. |
I managed to get what i wanted. Pretty funky all this 😄 Cloudflare has wrangler which runs the project locally. For vercel i managed now to upload the prebuilt and debug with the error messages. I have two minor issues so far and reached a render issue with Solid-js which we did fix for the cloudflare adapter, but vercel is building different and therefore i need to check how we can fix this as well. |
@AirBorne04 I guess the closest should be https://edge-runtime.vercel.app/getting-started |
Also getting this on Astro/cloudflare 6.1.1 and Astro 2.0.4. (Also using Solid, 1.6.10) Seems to happen whether adapter is in directory or advanced mode. Wrangler preview says " To use the new ReadableStream() constructor, enable the streams_enable_constructors feature flag," which is a little odd since CF says they are default on https://developers.cloudflare.com/workers/platform/compatibility-dates/#change-history. |
Seems related to #4039. Also getting an "X not supported by the browser, returning |
I have been trying those, but did not manage to connect their
That is different, i have been running the same code on Cloudflare and it works as expected. For the flags you need to add it in the For this issue here i think there a slight changes in the implementation across vercel edge and cloudflare worker, or the compilation result are not 100% comparable, though the errors I could find do not seem to be discussable much. Here is what I have found and would address with a PR shortly.
|
@AirBorne04 - To use the new ReadableStream() constructor, enable the streams_enable_constructors feature flag," is a different error, but I primarily meant to say that I was also getting the OP's --
The build doesn't break, but it just renders a blank page live. I used CF's real time functions logs, which, show success when hitting the functions endpoints directly, but throw the encoding error when trying to return HTML... The bit about streams_enable_contructors flag on wrangler preview was just some extra info that I wasn't sure if it were relevant or not. |
@AirBorne04 Found something! Using |
This is actually the error message from SolidJS when the server code of (solidjs/web) is run from a browser context. The import handling is automagic and not easy to control during build.
Ah alright, the streams_enabled has nothing to do with it. I did not see the error in locally, but it makes sense.
It has implications, because other packages that are imported need this setting to |
@AirBorne04 Spoke with @matthewp and I agree adding an esbuild step to Vercel is a good approach. This would mirror our cloudflare fix, and they're more or less the same deployment target 👍 |
Do we think it makes sense to somehow / somewhere consolidate those build settings for the edge runtimes? If even possible? I will add the step to the vercel adapter as well in the meantime. |
@AirBorne04 That's a good question! We'd probably need a shared "adapter utils" package (or some equivalent) to keep the packages separate. Not a bad idea though. Could possibly split out cloudflare utils for Vercel to depend on too 🤔 |
Maybe some sort of a edge runtime adapter base / util package. |
@AirBorne04 Feel free to experiment in a PR commit if you want! Otherwise, happy to explore in a separate PR |
@AirBorne04 Confirming if you plan to PR a fix! Otherwise, I'm happy to pick it up. |
Yes i will put something together, also managed to get the edge-runtime running locally, maybe something for the preview option for the vercel adapter. |
What version of
astro
are you using?1.9.0
Are you using an SSR adapter? If so, which one?
Vercel (edge)
What package manager are you using?
pnpm
What operating system are you using?
MacOS
Describe the Bug
When using Solid components in an app hosted on Vercel edge, it throws the following error:
Link to Minimal Reproducible Example
https://github.com/pilcrowOnPaper/astro-vercel-solid
Participation
The text was updated successfully, but these errors were encountered: