-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(resolve): auto externalize node builtins for noExternal: true
in node
#16019
Conversation
Run & review this pull request in StackBlitz Codeflow. |
just update to 5.2.2 but still got error |
Can you open a new issue and repro for it? I'm pretty sure this PR is working correctly |
no worry, I was able to fix it. Thank you |
@acoderacom how did you fix it? i have the same issue. |
@jjenzz Are you using remix with netlify? no? |
@acoderacom yes, i was using the netlify edge template and later realised that it relies on deno runtime. |
@jjenzz you need to use @netlify/remix-runtime |
@acoderacom yeah, i did but other packages still complained. i raised the issue in remix discord and netlify introduced a fix here yday tho 🙌 netlify/remix-compute#317 |
Description
In this PR, when setting
ssr.noExternal: true
andssr.target: 'node'
(default), node builtins will be auto-externalized. Without this PR, it'll error thatCannot bundle Node.js built-in "node:http" imported from .... Consider disabling ssr.noExternal or remove the built-in dependency.
, which I think is odd because we know we're building for node, and it's safe to auto-externalize by default.This feature was added long ago in #4490 for webworkers. And there's also workarounds by setting node builtins in
ssr.external
manually yourself. But I figured to kick off this idea since it feels like a safe default.Additional context
Found this while reviewing withastro/astro#10202. I figured for users who build to node and want to bundle everything, we can suggest
ssr.noExternal: true
only and it'll work, otherwise they need to workaround setting builtins inssr.external
manually.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).