Error when hosted on pages but not on local
okay... if I have minify/rocketloader off, cf shouldn't touch any of my code right? so why is it that the same exact code hosted on pages vs locally (via wrangler pages dev produces very weird bugs? 😩 https://t89.s3-us-west-1.amazonaws.com/2023/02/FFZG3c7N/unknown.mp4
i have no idea what is causing this and it seems the only difference is cloudflare
(cf version goes unstyled for a sec, throws some ssr errors)
wtf?!
i can reproduce it on my phone too, so it isn't a browser thing
26 Replies
Do you have a source repo we can test with?
GitHub
blahaj-app/apps/site at master · repository/blahaj-app
Contribute to repository/blahaj-app development by creating an account on GitHub.
Also, love the Blåhaj!
😄
Ok, so first issue. Without any modifications to your repo(
cd /apps/site
, volta pin [email protected]
, and pnpm install
), I immediately get an error on dev
that Buffer is not defined. Did you manually polyfill that somewhere?pnpm doesn’t run the post install script for whatever reason
just run pnpm postinstall
and it’ll setup the polyfill
Derp
Wait
(may also take a few installs and uninstalls of remix-esbuild-override)
It did run it, but it didn't work...
that package is buggy in pnpm
ah
well 😅
something something related to module resoluton... no idea
Found the issue. Turns out
esbuild
doesn't actually get installed if you don't manually ask for it...
Can't override esbuild if it doesn't existweird 🤔
the CI script is able to build it fine w/o anything special
GitHub
blahaj-app/deploy-site.yml at master · repository/blahaj-app
Contribute to repository/blahaj-app development by creating an account on GitHub.
TBH, issues like this is why I gave up on Remix and most other React Metaframeworks
Cough Cough Vercel Cough Cough
Can you send me your lockfile?
it's in the root of the repo, but this is the one i have
(you may also need a database, i have a one for dev already setup so i can just send you the details if needed)
Oh...
Ok, I was under the impression that I only needed to run site...
site talks to db directly
i was just really wondering if anyone knew if pages does something weird to a site's code
because from first look... the code is identical
Might be injecting a Web Analytics script?
maybe... i'll see tomorrow once i've had some sleep
otherwise i might just move it to workers completely and not deal with pages
Do you have any minification on?
Pages itself doesn't touch code but other Cloudflare things can
it's on a pages.dev domain, so I don't think I can control that even
but I turned it off on my domain jusssst in case
I think this is just a difference of building for dev vs building for production and is standard react minification errors... had some of those happen recently at my works app though I dont do frontend so not sure what they did to fix it tbh (same exact error too the #418)
I'm hosting the prod build locally
even checked sha1 sums of the bundle... it's the same?! 😩
ill try asking the remix people...