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.

TypeError: Cannot read property 'emit' of undefined

See original GitHub issue

Soon after run build this message appears, can anyone help me?

/Users/***/Documents/www/myapp/node_modules/webpack-obfuscator/dist/index.js:22
        compiler.hooks.emit.tap(pluginName, (compilation) => {
                      ^

TypeError: Cannot read property 'emit' of undefined
    at WebpackObfuscator.apply (/Users/***/Documents/www/myapp/node_modules/webpack-obfuscator/dist/index.js:22:23)
    at Compiler.apply (/Users/***/Documents/www/myapp/node_modules/tapable/lib/Tapable.js:375:16)
    at webpack (/Users/***/Documents/www/myapp/node_modules/webpack/lib/webpack.js:33:19)
    at err (/Users/***/Documents/www/myapp/build/build.js:19:3)
    at next (/Users/***/Documents/www/myapp/node_modules/rimraf/rimraf.js:75:7)
    at FSReqWrap.CB [as oncomplete] (/Users/***/Documents/www/myapp/node_modules/rimraf/rimraf.js:111:9)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
saaifulcommented, Jul 9, 2019

I saw the same error when I used directly the latest “webpack-obfuscator”, but it wasn’t compatible with “webpack” itself. I located an older version that works. In some cases other plugins may also interfere.

Same for me, new version is the issue. npm install --save-dev webpack-obfuscator@0.17.3 solved the issue.

1reaction
sanex3339commented, Jul 9, 2019

Latest version requires webpack 4+ version. I released new version and added webpack 4.3.0+ to peerDependencies

Read more comments on GitHub >

github_iconTop Results From Across the Web

throws ERROR TypeError: Cannot read property 'emit' of ...
I created an event emitter as a member of MyComponent , but the event handler method is not able to access the event...
Read more >
TypeError: Cannot read property 'emit' of undefined #35 - GitHub
Hi, I'm getting the following errors on glitch server socket.to(roomId).broadcast.emit('user-connected', userId); ^ TypeError: Cannot read ...
Read more >
TypeError: Cannot read property '$emit' of undefined - Laracasts
TypeError : Cannot read property '$emit' of undefined. I want to call to a method in my parent component within my child component....
Read more >
Javascript – TypeError: Cannot read property 'emit' of undefined
The problem is that Whenever I try to fire "this.io.emit" event a TypeError occurs. It gives only while I write this statement "this.io.emit"...
Read more >
"Cannot read property 'emit' of undefined" when calling ...
Hi! I'm trying to integrate Mediasoup into my project and started by simply porting this example GitHub - mkhahani/mediasoup-sample-app: Mediasoup v3 sample ...
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