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

Module not found: Error: Can't resolve 'module' in '...' #5423

Closed
Bamieh opened this issue Aug 1, 2017 · 7 comments
Closed

Module not found: Error: Can't resolve 'module' in '...' #5423

Bamieh opened this issue Aug 1, 2017 · 7 comments

Comments

@Bamieh
Copy link

Bamieh commented Aug 1, 2017

Do you want to request a feature or report a bug?
bug

What is the current behavior?

const module = require('module')
// Module not found: Error: Can't resolve 'module' in '...'

This line of code throws on error even in "node" target

If the current behavior is a bug, please provide the steps to reproduce.
just requiring the module module will cause the issue.

What is the expected behavior?
module is a native module in node, just like fs or http, webpack should not throw when its required.

If this is a feature request, what is motivation or use case for changing the behavior?
I need to use the module module!

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

latest webpack version, nodeJS 8.1.3, mac OSX

@Bamieh
Copy link
Author

Bamieh commented Aug 1, 2017

As suggested by Michael McLaughlin @mmclau14 on webpack gitter. This could be worked around by replacing the require with

const NativeModule = module.constructor;

however i still believe this should be solved not worked around, as it causes unexpected issues.

@sokra
Copy link
Member

sokra commented Aug 1, 2017

webpack doesn't support the module module.

@Bamieh
Copy link
Author

Bamieh commented Aug 2, 2017

@sokra can you elaborate on the reason?

@webpack-bot
Copy link
Contributor

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@ThatBrianDude
Copy link

Any updates here?

Getting this error:

Module not found: Can't resolve 'module' in 'project_root\node_modules\load-grunt-tasks\node_modules\resolve-from'

@alexander-akait
Copy link
Member

@ThatBrianDude please recrea new issue using issue template. This problem is very old and don't related to your. Thanks!

@mjsarfatti
Copy link

@ThatBrianDude's problem is actually the exact same issue. Any development here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants