Error: Cannot find module ‘./../node_modules/lodash/lodash.js’ Webpack

Have you added the noParse feature in webpack and started getting the following error :

Error: Cannot find module ‘./../node_modules/lodash/lodash.js’

Make the following change in your webpack config file to fix the issue.

// change 

module: {
    noParse: path.join(__dirname, 'node_modules'),
}

// to 

module: {
    noParse: /path.join(__dirname, 'node_modules')/,
}

Note: noParse has to be a regex.


You may also like...