You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're not using getRequestEvent(), then you don't need to worry about this. If you are using it, then you should set the nodejs_compat flag, as mentioned in the warning.
Yes, that was the initial idea but it seems that generating a wrangler configuration is prone to getting out of sync with the user config if they don't re-run the build. Instead, the Cloudflare folks suggested adding an error message if the appropriate flags aren't set. Otherwise, we need to look at trying to treeshake this import away if the getRequestEvent() function isn't used.
I'd highly recommend enabling the nodejs_als compatibility flag in the meantime if you want to get rid of the warning. This doesn't seem to bundle any extra code in the worker from my testing compared to enabling the nodejs_compat flag which does.
Yes, that was the initial idea but it seems that generating a wrangler configuration is prone to getting out of sync with the user config if they don't re-run the build.
That's definitely a potential footgun, but if the user doesn't re-run the build their SvelteKit app will also be out of sync, so I'm not sure it's a blocking concern. Generated Wrangler configuration is the approach we're taking with the Cloudflare Vite plugin, and it's designed to solve problems like this (frameworks requiring deployment config that users don't necessarily need).
Activity
frederichoule commentedon Apr 2, 2025
Seems to be caused by #13582
Conduitry commentedon Apr 2, 2025
If you're not using
getRequestEvent()
, then you don't need to worry about this. If you are using it, then you should set thenodejs_compat
flag, as mentioned in the warning.@eltigerchino I think you were mentioning some way we could deal with this by having the adapter influence the configuration of the deployment? https://developers.cloudflare.com/workers/wrangler/configuration/#generated-wrangler-configuration
frederichoule commentedon Apr 2, 2025
I'm not using
getRequestEvent()
, so it doesn't affect me (and I don't want/have thenodejs_compat
flag).But I still like to have clean logs without warnings :-)
eltigerchino commentedon Apr 3, 2025
Yes, that was the initial idea but it seems that generating a wrangler configuration is prone to getting out of sync with the user config if they don't re-run the build. Instead, the Cloudflare folks suggested adding an error message if the appropriate flags aren't set. Otherwise, we need to look at trying to treeshake this import away if the
getRequestEvent()
function isn't used.I'd highly recommend enabling the
nodejs_als
compatibility flag in the meantime if you want to get rid of the warning. This doesn't seem to bundle any extra code in the worker from my testing compared to enabling thenodejs_compat
flag which does.penalosa commentedon Jul 14, 2025
That's definitely a potential footgun, but if the user doesn't re-run the build their SvelteKit app will also be out of sync, so I'm not sure it's a blocking concern. Generated Wrangler configuration is the approach we're taking with the Cloudflare Vite plugin, and it's designed to solve problems like this (frameworks requiring deployment config that users don't necessarily need).