Need Help - Remix + Vite (Cloudflare Pages)

I migrated my remix application from a nodejs based template to the cloudflare template. On trying to deploy my application on Cloudflare pages, I encounter errors that make the build process fail. The main problem is that I have packages that rely on some node internals and even after turning on the nodejs_compat option for the project, the errors still show up. I have attached a downloaded log to help.
4 Replies
Mike Oristian
Mike Oristian3mo ago
having this same problem - Drizzle pg libraries can't rely on node internals.
jogo-list-by-toy
the same,i think pages is not very compatible to fullstack app
Elliot Hesp
Elliot Hesp2mo ago
Not all node internals are supported. You'll need to use packages which don't rely on those. For example the pg package, you'd need to use a http/ws driver instead
Jay
Jay2mo ago
I am also running into this issue...'stream' and 'crypto' are required somehow in node.js packages and I can't access the original files.
[ERROR] Could not resolve "crypto"
14:19:14.295
14:19:14.295 ../../node_modules/.pnpm/cookie-signature@1.2.1/node_modules/cookie-signature/index.js:5:21:
14:19:14.295 5 │ var crypto = require('crypto');
14:19:14.295 ╵ ~~~~~~~~
14:19:14.296
14:19:14.296 The package "crypto" wasn't found on the file system but is built into node.
14:19:14.296 Add the "nodejs_compat" compatibility flag to your Pages project and make sure to prefix the module name with "node:" to enable Node.js compatibility.
14:19:14.296
14:19:14.296
14:19:14.296 ✘ [ERROR] Could not resolve "stream"
14:19:14.296
14:19:14.296 ../../node_modules/.pnpm/stream-slice@0.1.2/node_modules/stream-slice/index.js:3:24:
14:19:14.296 3 │ var Transform = require('stream').Transform;
[ERROR] Could not resolve "crypto"
14:19:14.295
14:19:14.295 ../../node_modules/.pnpm/cookie-signature@1.2.1/node_modules/cookie-signature/index.js:5:21:
14:19:14.295 5 │ var crypto = require('crypto');
14:19:14.295 ╵ ~~~~~~~~
14:19:14.296
14:19:14.296 The package "crypto" wasn't found on the file system but is built into node.
14:19:14.296 Add the "nodejs_compat" compatibility flag to your Pages project and make sure to prefix the module name with "node:" to enable Node.js compatibility.
14:19:14.296
14:19:14.296
14:19:14.296 ✘ [ERROR] Could not resolve "stream"
14:19:14.296
14:19:14.296 ../../node_modules/.pnpm/stream-slice@0.1.2/node_modules/stream-slice/index.js:3:24:
14:19:14.296 3 │ var Transform = require('stream').Transform;
Ah...fixed it. Instead of using @remix-run/node you have to switch to @remix-run/cloudflare.
Want results from more Discord servers?
Add your server
More Posts
An unknown error occured. Contact your account team or Cloudflare support...(Code: 8000000)I am getting error while trying to create a pages application. I have done it before without any proDomain Transfer from GodaddyI've done all the prerequisites on Godaddy's end. I've turned off the privacy, downgraded plan, unloCatch-All email routing not workingI have created and email worker and enabled `catch-all` rule, but the worker doesn't receive emails Sveltekit +page.server.ts load() function, both fetch() and event.fetch() failI have a sveltekit app running on Cloudflare pages. In server side load(event) functions, neither feWebsite is 404ing but seems to be working according to Cloudflare dashboardI'm currently trying to deploy an Angular app through Cloudflare pages via Github. According to CloCertain get request not working in workers. but works in browserhi, anyone know why i cant do fetch on this endpoint? keep getting 400 bad request. it works fine inGetting {"request_id":"86aabe63b7a21cbc-BUD","message":"An error occurred... (Code: 10000) in UIHello, when I am trying to access my workers or KV, whatever page of the UI i use, I am getting a buPages local development with Wrangler - Static assets in /dist and Functions in /functions - How toI'm looking to debug a Pages Function locally using Wrangler. The `wrangler pages dev [directory]` cNeed help - Remix+ViteI migrated my remix application from a nodejs based template to the cloudflare template. On trying tFirst time using workers (cron trigger), CANNOT get it to work for me.I've followed the instructions, it's showing up on the panel, I'm just not getting anything back