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/adapter-cloudflare@4.6.1
└─┬ wrangler@3.62.0
└─┬ miniflare@3.20240620.0
└── youch@3.3.3
└─┬ @sveltejs/adapter-cloudflare@4.6.1
└─┬ wrangler@3.62.0
└─┬ miniflare@3.20240620.0
└── youch@3.3.3
So the adapter is throwing the error of an incompatibility essentially of its own dependencies.... adapter-cloudflare@4.6.1
1 Reply
boggin
boggin2mo 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