-
Notifications
You must be signed in to change notification settings - Fork 29k
Closed
Labels
RuntimeRelated to Node.js or Edge Runtime with Next.js.Related to Node.js or Edge Runtime with Next.js.WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked
Description
Link to the code that reproduces this issue
To Reproduce
Please follow the reproduction steps in the linked issue above.
Current vs. Expected behavior
Current
Next.js throws an error, unable to import a built-in _http_common
module in Node.js.
Expectd
Next.js properly imports the built-in module.
Provide environment information
Irrelevant, this is a webpack configuration issue.
Which area(s) are affected? (Select all that apply)
Developer Experience, Runtime, Webpack
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
I believe this is caused by the Next's default webpack config not listing _http_common
in config.externals
.
Any thoughts on listing all built-in Node.js modules as external?
{
// All built-in modules in Node.js must be treated as external.
externals: require('module').builtinModules
}
I'm proposing this because contributors report that adding _http_common
into config.externals
helps them. This should be handled on Next's side.
SimonLafrikh
Metadata
Metadata
Assignees
Labels
RuntimeRelated to Node.js or Edge Runtime with Next.js.Related to Node.js or Edge Runtime with Next.js.WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked