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)
$ curl -sL https://b823e205.blahaj-app.pages.dev/build/_shared/chunk-6PM3H3BH.js | sha1sum
e9c75f39a61321d6ce63e4449c0849330cf4fc7f -
$ curl -sL https://406c-72-109-113-150.ngrok.io/build/_shared/chunk-6PM3H3BH.js | sha1sum
e9c75f39a61321d6ce63e4449c0849330cf4fc7f -
$ curl -sL https://406c-72-109-113-150.ngrok.io/build/entry.client-U75CJAHD.js | sha1sum
017dccc8d8ae194863ff1af0ea66b8d748da65bb -
$ curl -sL https://b823e205.blahaj-app.pages.dev/build/entry.client-U75CJAHD.js | sha1sum
017dccc8d8ae194863ff1af0ea66b8d748da65bb -
$ curl -sL https://b823e205.blahaj-app.pages.dev/build/_shared/chunk-6PM3H3BH.js | sha1sum
e9c75f39a61321d6ce63e4449c0849330cf4fc7f -
$ curl -sL https://406c-72-109-113-150.ngrok.io/build/_shared/chunk-6PM3H3BH.js | sha1sum
e9c75f39a61321d6ce63e4449c0849330cf4fc7f -
$ curl -sL https://406c-72-109-113-150.ngrok.io/build/entry.client-U75CJAHD.js | sha1sum
017dccc8d8ae194863ff1af0ea66b8d748da65bb -
$ curl -sL https://b823e205.blahaj-app.pages.dev/build/entry.client-U75CJAHD.js | sha1sum
017dccc8d8ae194863ff1af0ea66b8d748da65bb -
wtf?! i can reproduce it on my phone too, so it isn't a browser thing
26 Replies
Hello, I’m Allie!
Do you have a source repo we can test with?
m
mOP•2y ago
GitHub
blahaj-app/apps/site at master · repository/blahaj-app
Contribute to repository/blahaj-app development by creating an account on GitHub.
Hello, I’m Allie!
Also, love the Blåhaj!
m
mOP•2y ago
😄
Hello, I’m Allie!
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?
m
mOP•2y ago
pnpm doesn’t run the post install script for whatever reason just run pnpm postinstall and it’ll setup the polyfill
Hello, I’m Allie!
Derp Wait
Scope: all 5 workspace projects

dependencies:
+ @blahaj-app/static <- ../../packages/static
+ @chakra-ui/react 2.4.9
+ @emotion/cache 11.10.5
+ @emotion/react 11.10.5
+ @emotion/server 11.10.0
+ @emotion/styled 11.10.5
+ @neondatabase/serverless 0.2.4
+ @react-hook/resize-observer 1.2.6
+ @remix-run/cloudflare 1.12.0
+ @remix-run/cloudflare-pages 1.12.0
+ @remix-run/react 1.12.0
+ @visx/curve 3.0.0
+ @visx/event 3.0.0
+ @visx/gradient 3.0.0
+ @visx/responsive 3.0.0
+ @visx/scale 3.0.0
+ @visx/shape 3.0.0
+ @visx/tooltip 3.0.0
+ cross-env 7.0.3
+ d3-array 3.2.2
+ date-fns 2.29.3
+ eases 1.0.8
+ framer-motion 9.0.1
+ kysely 0.23.4
+ mapbox-gl 2.12.0
+ moize 6.1.5
+ react 18.2.0
+ react-dom 18.2.0
+ react-icons 4.7.1
+ react-map-gl 7.0.21
+ remix-params-helper 0.4.10
+ remix-routes 1.3.1
+ remix-typedjson 0.1.7
+ simplebar-react 3.2.1
+ throttle-debounce 5.0.0
+ usehooks-ts 2.9.1
+ zod 3.20.6

devDependencies:
+ @cloudflare/workers-types 4.20230115.0
+ @esbuild-plugins/node-globals-polyfill 0.2.3
+ @remix-run/dev 1.12.0
+ @remix-run/eslint-config 1.12.0
+ @types/d3-array 3.0.4
+ @types/eases 1.0.2
+ @types/mapbox-gl 2.7.10
+ @types/react 18.0.27
+ @types/react-dom 18.0.10
+ @types/throttle-debounce 5.0.0
+ eslint 8.33.0
+ eslint-plugin-prefer-arrow-functions 3.1.4
+ npm-run-all 4.1.5
+ remix 1.12.0
+ remix-esbuild-override 3.0.4
+ typescript 4.9.5
+ typescript-remix-routes-plugin 1.0.0
+ wrangler 2.9.0

. postinstall$ remix-esbuild-override
│ 💽 esbuild patch by remix-esbuild-override is complete.
└─ Done in 220ms
Done in 983ms
Scope: all 5 workspace projects

dependencies:
+ @blahaj-app/static <- ../../packages/static
+ @chakra-ui/react 2.4.9
+ @emotion/cache 11.10.5
+ @emotion/react 11.10.5
+ @emotion/server 11.10.0
+ @emotion/styled 11.10.5
+ @neondatabase/serverless 0.2.4
+ @react-hook/resize-observer 1.2.6
+ @remix-run/cloudflare 1.12.0
+ @remix-run/cloudflare-pages 1.12.0
+ @remix-run/react 1.12.0
+ @visx/curve 3.0.0
+ @visx/event 3.0.0
+ @visx/gradient 3.0.0
+ @visx/responsive 3.0.0
+ @visx/scale 3.0.0
+ @visx/shape 3.0.0
+ @visx/tooltip 3.0.0
+ cross-env 7.0.3
+ d3-array 3.2.2
+ date-fns 2.29.3
+ eases 1.0.8
+ framer-motion 9.0.1
+ kysely 0.23.4
+ mapbox-gl 2.12.0
+ moize 6.1.5
+ react 18.2.0
+ react-dom 18.2.0
+ react-icons 4.7.1
+ react-map-gl 7.0.21
+ remix-params-helper 0.4.10
+ remix-routes 1.3.1
+ remix-typedjson 0.1.7
+ simplebar-react 3.2.1
+ throttle-debounce 5.0.0
+ usehooks-ts 2.9.1
+ zod 3.20.6

devDependencies:
+ @cloudflare/workers-types 4.20230115.0
+ @esbuild-plugins/node-globals-polyfill 0.2.3
+ @remix-run/dev 1.12.0
+ @remix-run/eslint-config 1.12.0
+ @types/d3-array 3.0.4
+ @types/eases 1.0.2
+ @types/mapbox-gl 2.7.10
+ @types/react 18.0.27
+ @types/react-dom 18.0.10
+ @types/throttle-debounce 5.0.0
+ eslint 8.33.0
+ eslint-plugin-prefer-arrow-functions 3.1.4
+ npm-run-all 4.1.5
+ remix 1.12.0
+ remix-esbuild-override 3.0.4
+ typescript 4.9.5
+ typescript-remix-routes-plugin 1.0.0
+ wrangler 2.9.0

. postinstall$ remix-esbuild-override
│ 💽 esbuild patch by remix-esbuild-override is complete.
└─ Done in 220ms
Done in 983ms
m
mOP•2y ago
(may also take a few installs and uninstalls of remix-esbuild-override)
Hello, I’m Allie!
It did run it, but it didn't work...
m
mOP•2y ago
that package is buggy in pnpm ah well 😅 something something related to module resoluton... no idea
Hello, I’m Allie!
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 exist
m
mOP•2y ago
weird 🤔 the CI script is able to build it fine w/o anything special
m
mOP•2y ago
Hello, I’m Allie!
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?
m
mOP•2y ago
it's in the root of the repo, but this is the one i have
m
mOP•2y ago
(you may also need a database, i have a one for dev already setup so i can just send you the details if needed)
Hello, I’m Allie!
Oh... Ok, I was under the impression that I only needed to run site...
m
mOP•2y ago
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
Hello, I’m Allie!
Might be injecting a Web Analytics script?
m
mOP•2y ago
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
Walshy
Walshy•2y ago
Do you have any minification on? Pages itself doesn't touch code but other Cloudflare things can
m
mOP•2y ago
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
Unsmart
Unsmart•2y ago
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)
m
mOP•2y ago
I'm hosting the prod build locally even checked sha1 sums of the bundle... it's the same?! 😩 ill try asking the remix people...
m
mOP•2y ago
facepalm
Want results from more Discord servers?
Add your server