Cant build a page with Sveltekit?
Hello I've been working on my Sveltekit app locally for a few weeks and wanted to try it out on Cloudflare pages. But it fails to build. What's going on? ๐ข
14 Replies
Looks like you're using node 12 but at least 16 is required
Try bumping your
NODE_VERSION
env var to 16Add the environment variable NODE_VERSION with the value 16
too slow
Too old
ooh thank you. Got a little bit further but a lot of new errors.
or its not possible to run with packages?
You can run packages with Functions, but you won't be able to run Node.js packages, or things that rely on Node.js modules, probably like mongodb.
Workers run JavaScript via V8, but not Node.js
aha :/
If your site is static, you could use these things in your build script and then output HTML from it
but you won't be able to hit something like Mongo with Functions today, at least not without some kind of HTTP transformer for the queries
Wait I thought with pages you could run node_compat mode? https://github.com/cloudflare/wrangler2/issues/1074
GitHub
Feature Request: Support --node-compat in wrangler pages build ยท Is...
What version of Wrangler are you using? 2.0.6 or beta What operating system are you using? Mac Describe the Bug App was rewrited from CRA to Remix and i've moved all config from Remix Cloud...
Functions doesn't support arbitrary TCP (only HTTP), so even if you could use node_compat MongoDB is still not usable unfortunately
@Isaac McFadyen | YYZ01 thank you for clarification friend ๐
Howdy hoo. We actually explored this stack. (functions didn't work for us)
our setup is as follows:
frontend
cloudflare pages
backend
cloudflare workers
websockets (not socket.io)
db
mongodb atlas (using this forked adapter for mongo data API https://github.com/CodeCrowCorp/mongodb)