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 parse failed: Maximum call stack size exceeded #25

Closed
t47io opened this issue Mar 10, 2018 · 5 comments
Closed

Module parse failed: Maximum call stack size exceeded #25

t47io opened this issue Mar 10, 2018 · 5 comments

Comments

@t47io
Copy link

t47io commented Mar 10, 2018

Awesome plugin (1.1.1), but I run into the following error in my webpack (3.11.0) build [node 8.10.0]:

    ERROR in ./node_modules/lodash/lodash.js
    Module parse failed: Maximum call stack size exceeded
    You may need an appropriate loader to handle this file type.
    RangeError: Maximum call stack size exceeded
        at Function.keys (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:57:33)
        at Object.get (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:90:14)
        at Object.keys.map.k (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:19)
        at Array.map (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:6)
        at Object.get (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:90:14)
        at Object.keys.map.k (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:19)
        at Array.map (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:6)
        at Object.get (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:90:14)
        at Object.keys.map.k (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:19)
        at Array.map (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:6)
        at Object.get (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:90:14)
        at Object.keys.map.k (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:19)
        at Array.map (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:6)
        at Object.get (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:90:14)
        at Object.keys.map.k (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:19)
        at Array.map (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:6)
        at Object.get (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:90:14)
        at Object.keys.map.k (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:19)
        at Array.map (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:6)
        at Object.get (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:90:14)
        at Object.keys.map.k (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:19)
        at Array.map (<anonymous>)
        at wrap (/Website_Server/t47io/main/node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:58:6)
     @ ./node_modules/html-webpack-plugin/lib/loader.js!./applications/index.html 1:8-51

Note, it's not about lodash, I got this error hundreds of times basically for everything, loaders, etc. I do get the SMP outputs though (before webpack summary prints), but the build fails because of these errors. Any ideas?

@stephencookdev
Copy link
Owner

stephencookdev commented Mar 10, 2018

Thanks for raising @t47io :)
I've not seen the error before... Could you share your webpack config? (or whatever subset that you can share that still reproduces the issue?)
I'll do my best to work it out from just that stack trace, though, on Monday

@stephencookdev
Copy link
Owner

Yeah so it looks like the issue here is that one of your plugins has a circular reference. SMP fails a bit handling this, and tries to wrap the plugin parts infinitely

We'll just need to add a stop-mark, so we don't try and wrap something that's already wrapped

Would you mind sharing which plugins you're using? It would give me more peace of mind to find the offending plugin, and tests its compatibility properly.

But I should be fine to reproduce and fix with what I've seen :)

@t47io
Copy link
Author

t47io commented Mar 14, 2018

@stephencookdev Thanks a lot, sorry for the delay in response.

Here are all the plugins:

# webpack 3.11.0

webpack.EnvironmentPlugin
webpack.LoaderOptionsPlugin
HtmlWebpackPlugin # 2.30.1 html-webpack-plugin
webpack.optimize.CommonsChunkPlugin
PurifyCSSPlugin # 0.7.0 purifycss-webpack
LodashModuleReplacementPlugin # 0.11.4 lodash-webpack-plugin
webpack.HashedModuleIdsPlugin
ManifestPlugin # 1.3.2 webpack-manifest-plugin
ChunkRenamePlugin # 1.1.1 chunk-rename-webpack-plugin
BabelMinifyPlugin # 0.3.0 babel-minify-webpack-plugin
BrotliPlugin # 0.5.0 brotli-webpack-plugin
ZopfliPlugin # 0.1.0 zopfli-webpack-plugin
BundleAnalyzerPlugin # 2.11.1 webpack-bundle-analyzer

Not sure if loaders are relevant:

babel-loader # 7.1.4
css-loader # 0.28.10
postcss-loader # 2.1.1
resolve-url-loader # 2.3.0
sass-loader # 6.0.7
url-loader # 0.6.2
file-loader # 1.1.11
svg-url-loader # 2.3.2
null-loader # 0.1.1

@stephencookdev
Copy link
Owner

Nice, so it looks like lodash-webpack-plugin was the plugin causing issues. I've confirmed that #27 fixes this - so upgrading to 1.1.2 should resolve the issue for you! :)

Let me know if you're still having issues

@t47io
Copy link
Author

t47io commented Mar 14, 2018

Works like a charm!

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

2 participants