willkelly
Potential upstream problem in solid for users of Astro + solid + cloudflare?
@Rachael - took one more look at this:
Here's is the supabase's fork of node-fetch:
https://github.com/supabase/node-fetch/blob/2.x/package.json#L7...
They have a main field, and a browser field. The fix I gave you above removes
browser
from the vite resolution conditions to fix it for solid, bc solid does not want the implicit mapping of worker -> back to browser that some of these bundlers do. (Bc for solid, worker != browser. The server version of solid is what runs in workers). (The default for Vite ['browser', 'module', 'jsnext:main', 'jsnext']), so you're getting the server build of node-fetch, which is importing node's stream, which is what is throwing your error.
The fix in solid shouldn't break this I wouldn't, cause the proposed fix thus far is to just remove that browser field from solid only, (which shouldnt' be needed tbh, but we can't change the bundlers. Imo, if the bundler shouldn't do a backwards mapping to the older browser field is a newer module.exports resolves to a valid identifier, but that's out of solid core's hands, but of course then that'd break other things from the bundlers' ends at this point.). Breakage would occur when a tool is trying to resolve solid's exports itself but don't support the modules.exports fields, which shouldn't be too many scenarios I wouldn't think. Most folks are probably compiling through vite / rollup / webpack / etc which can all read module.exports49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
Maybe.. https://github.com/supabase/postgrest-js/issues/465
But also, it says,
Consider disabling ssr.noExternal or remove the built-in dependency.
. Do you have it set to no external ?49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
I'm not sure if it would be breaking or not from core. I don't think so. This workaround may be exlcluding some other conditions needed to get the correct supabase bundle
49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
What errors are you getting?
The package management / bundling is a bit outside my comfort zone, but what should be happening with that fix I linked is that it's preventing Vite from mapping backwards from
workers
conditional export to the browser field (which is the client build of solid which is breaking when done in SSR)49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
Well, and depending on your dependencies this is a solution still:
https://discord.com/channels/830184174198718474/1239920931510554655/1249724228794585178
I think as long as you don't have other dependencies that break when manually setting the resolve fields for Vite, then this is fine. If I understand, this is what the PR to change solid will do anyway is get Vite and some other bundlers to stop mapping backwards from package.json exports to the browser field just because it's a worker..
49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
@ryansolid -> Not wanting to be pushy, but is there anything else I can help out with on thiss or an idea of when you might could look at it? I'm just trying keeping tabs on it to keep it from falling forgotten. I know there's a number of folks who do use the the cloudflare + solid + astro combo.
49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
@ryansolid -> Sorry one more ping here. I forgot to link the repo, but I played with it a bit more, and I think it works. (I.e. have a solidjs component test passing after pnpm patching solid and deleting the browser field) I'd love for you to check it out and see if this has now resolved upstream, and if there's anyone else that might also be an upstream blocker.
https://github.com/wkelly17/Solid-Jest-repro
I noticed it should be configurable with Jest here:
https://jestjs.io/docs/29.4/configuration#testenvironmentoptions-object
49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
Yeah, I figured it was a "bundler can get the right thing" type of error, but I also figured there are plenty of very unfamiliar config things to me (I'm not a jest user, and normally still work at the level that a lot of the tooling is wired together (i.e astro adapters, vite plugins) etc;). But I thought that Jest release sounded like it was a fix for this, and so yeah, maybe there's a flag somehwere or other way to indicate which export fields to point at for Jest. Idk if there's any other common legacy tools (i.e. don't support exports fileds) supported that previously didn't support package.json exports, but I'm willing to at least poke around and see what might be doable if there are other things that could use investigating
49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
@ryansolid -> Does this matter in terms of jest support?
https://jestjs.io/blog/2022/04/25/jest-28#packagejson-exports
I tried to read through the linked issues, but not sure I just quite grasp if this is relevant.
I tried to set up a small Jest + Solid repo and run some tests with pathching solid to remove the browser export altogether, but was getting some error about solid-js/web not providing an needed export.
I'll link it here in case it is a starting point (but idk if its helpful or not). https://github.com/solidjs/solid/releases
I'll link it here in case it is a starting point (but idk if its helpful or not). https://github.com/solidjs/solid/releases
49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
Well.. I can't speak for the astro core team, but I know that a previous verison of their adapter still works on cloudflare, but I don't think it's like immediate obselence for anyone still on the old version of their cloudflare adapter. I'm not sure if there's anything I can do (since it seems like a pretty large and complicated issue), but I'd be happy to run any of the stuff on my end that broke to see if something resolves
49 replies
Potential upstream problem in solid for users of Astro + solid + cloudflare?
hmmm. Breaking jest does sound significant. But, wouldnt this also keep solidstart from being able to deploy to cloudflare and other edge runtimes too? I'm out of league with publishing packages, but what would be needed to move the ball forward on it or would be ideal?
49 replies