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: Cannot resolve module 'module' in [...]source-map-support @ source-map-support.js 464:17-34

See original GitHub issue

I am using source-map-support 0.4.5 in a module of mine (let’s call it moduleA).

I then publish moduleA to npm and all’s well till that point.

Then I try to use that moduleA in another project of mine (let’s call it moduleUser). After I do npm install in moduleUser I try to do an npm run build which is configured in package.json as:

$ grep \"build\"\: package.json 
    "build": "webpack --progress --colors",

… and I then encounter (at the end of the build process) the following message which I can’t decipher:

ERROR in …/~/moduleA/~/source-map-support/source-map-support.js Module not found: Error: Cannot resolve module ‘module’ in /home/carsten/moduleUser/node_modules/moduleA/node_modules/source-map-support @ …/~/moduleA/~/source-map-support/source-map-support.js 464:17-34

Looking in the identified location in file source-map-support.js the line is:

var Module = require('module');

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:21
  • Comments:29

github_iconTop GitHub Comments

19reactions
noahgibbscommented, Jan 17, 2018

Seeing the same issue in 0.5.1, as well as unresolved ‘fs’ module. The following addition to the top level of my webpack.config.js fixes it:

node: {
    fs: "empty",
    module: "empty"
 }
16reactions
veeramarnicommented, Feb 3, 2017

I still see this issue in 0.4.11.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Cannot resolve module 'module'
I want to load module from variable string var abc = './../containers/BlankContainer'; require(abc);. but it cannot find module, ...
Read more >
source-map-support - npm
This module installs two things: a change to the stack property on Error objects and a handler for uncaught exceptions that mimics node's ......
Read more >
How to use the source-map-support.sourceMapSupport ... - Snyk
To help you get started, we've selected a few source-map-support. ... else { console.warn("NO source map support installed. could not find the module....
Read more >
How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change 'react-scripts' to 4.0.2 in your package.json and run `npm install` again :D Follow me on Twitter: ...
Read more >
Setting up a Serverless Project with Webpack, Babel, and Knex
The source-map-support module provides source map support for stack ... Module not found: Error: Can't resolve 'pg-query-stream' Module not ...
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