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.

Cannot read property 'compilation' of undefined

See original GitHub issue

I don’t know what’s going on here. Just reporting a bug.

⠋ building for production.../Users/vasyl/code/node_modules/critters-webpack-plugin/dist/critters.js:181
    compiler.hooks.compilation.tap(PLUGIN_NAME, function (compilation) {
                   ^

TypeError: Cannot read property 'compilation' of undefined
    at Critters.apply (/Users/vasyl/code/node_modules/critters-webpack-plugin/dist/critters.js:181:20)
    at Compiler.apply (/Users/vasyl/code/node_modules/tapable/lib/Tapable.js:375:16)
    at webpack (/Users/vasyl/code/node_modules/webpack/lib/webpack.js:33:19)
    at err (/Users/vasyl/code/build/build.js:19:5)
...

Webpack 3. VueJS project. Happens regardless of where in the plugin array I add critters.

I am far from being the best frontend developer. Not familiar with how webpack works either.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:8

github_iconTop GitHub Comments

3reactions
developitcommented, Jun 1, 2018

Ah - I think right now we require Webpack 4+, but it would be a simple change to support 3 and prior.

1reaction
koresarcommented, Sep 28, 2018

Finally I applied Critters to my project. And I must say that’s a huge relief!

  • The critical has 24 security issue (as per npm audit) and none was going to fix them
  • Much smaller node_modules
  • Faster, lighter builds
  • Just 1 line my vue.config.js - config.plugins.push(new (require("critters-webpack-plugin"))());.
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'compilation' of undefined #360
Operating System: MacOS Node Version: 10.10.0 NPM Version: 6.4.1 webpack Version: 3.12.0 ${package} Version: 2.0.1 Actual Behavior /.
Read more >
Cannot read property 'compilation' of undefined - Stack Overflow
So you'll need to install the plugin specifying the version when installation with npm : npm install --save-dev uglifyjs-webpack-plugin@1.
Read more >
Issue with purgeCSS with tailwind and Sage 9.0.10
error An unexpected error occurred: “could not find a copy of webpack to link ... TypeError: Cannot read property 'compilation' of undefined.
Read more >
Webpack error - Cannot read property 'thisCompilation' of ...
Webpack error - Cannot read property 'thisCompilation' of undefined. I am using copy-webpack-plugin to copy my entire images folder from src to dist...
Read more >
webpack打包时报错:TypeError: Cannot read ... - CSDN博客
webpack打包时报错:TypeError: Cannot read property 'compilation' of undefined · “相关推荐”对你有帮助么? · 分类专栏 · 最新评论 · 您愿意向朋友推荐“ ...
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