question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
ThatBrianDudecommented, Mar 28, 2018

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’

4reactions
Bamiehcommented, Aug 2, 2017

@sokra can you elaborate on the reason?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Cannot resolve module
In nodejs, when you call require("script1.js") it won't search in the current folder. You have to use require("./script2.js") , to specify ...
Read more >
Module not found | Can not resolve module in react - YouTube
React Course For Beginners - Learn React in 8 Hours · JS - JavaScript · Target container is not a DOM element error...
Read more >
How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Your browser can't play this video. ... How to fix ' Module not found : Can't resolve 'http' in ...' error with FCL...
Read more >
Resolve
Configure how modules are resolved. For example, when calling import 'lodash' in ES2015, the resolve options can change where webpack goes to look...
Read more >
Error: cannot find module [Node npm Error Solved]
In my case, I got it like this "Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\user\Desktop\Projects\Address Locator\ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found