dep problems sveltekit cloudflare-adapter when building

I can't build because of adapter-cloudflare's deps being wrong node modules? but the error must come from the adapter.... When I run build, it spits out many errors like:
✘ [ERROR] Could not resolve "url"

node_modules/youch/src/Youch.js:16:34:
16 │ const { fileURLToPath } = require('url')
╵ ~~~~~

Cannot use "url" when deploying to Cloudflare.
✘ [ERROR] Could not resolve "url"

node_modules/youch/src/Youch.js:16:34:
16 │ const { fileURLToPath } = require('url')
╵ ~~~~~

Cannot use "url" when deploying to Cloudflare.
from the deps like youch. When I npm ls youch, it spits out:
└─┬ @sveltejs/[email protected]
└─┬ @sveltejs/[email protected]
So the adapter is throwing the error of an incompatibility essentially of its own dependencies.... [email protected]
1 Reply
boggin
bogginOP5mo ago
There's also about 8 similar errors with wrangler regarding using nodemodules Found out the problem. For future searchers: You cannot use getPlatformProxy() outside of dev (specifically can't use outside of Node environmnets per the docs), so simply use a conditional dynamic import for dev.
if(dev){
const proxy = await getPlatformProxy();
if(dev){
const proxy = await getPlatformProxy();
Want results from more Discord servers?
Add your server