Skip to content
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

webpack 5 can't resolve _http_common node built in module #30091

Closed
remorses opened this issue Oct 20, 2021 · 3 comments
Closed

webpack 5 can't resolve _http_common node built in module #30091

remorses opened this issue Oct 20, 2021 · 3 comments
Labels
bug Issue was opened via the bug report template. Webpack Related to Webpack with Next.js.

Comments

@remorses
Copy link
Contributor

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

12

What browser are you using?

Chrome

What operating system are you using?

Mac Big Sur

How are you deploying your application?

not relevant

Describe the Bug

When using webpack 5, you cannot import or require the built in module _http_common (this module obviously is only used server side inside getStaticProps)

It works on webpack 4

Expected Behavior

I should be able to import _http_common

To Reproduce

https://github.com/remorses/webpack5-next-bug-code-elimination

@remorses remorses added the bug Issue was opened via the bug report template. label Oct 20, 2021
@timneutkens timneutkens added the SWC Related to minification/transpilation in Next.js. label Oct 31, 2021
@timneutkens timneutkens added Webpack Related to Webpack with Next.js. and removed SWC Related to minification/transpilation in Next.js. labels Nov 8, 2021
@timneutkens
Copy link
Member

timneutkens commented Nov 8, 2021

Turns out this is not related to SWC: #31166, I've moved it to area: Compiler.

@remorses
Copy link
Contributor Author

remorses commented Nov 8, 2021

The problem is NodeTargetPlugin here https://github.com/webpack/webpack/blob/14dd4f912c013f060bf7843a3d5462a51ff3051b/lib/node/NodeTargetPlugin.js#L12

It's missing the _http_common builtin module

In nextjs the plugin is imported here i think

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. Webpack Related to Webpack with Next.js.
Projects
None yet
Development

No branches or pull requests

2 participants