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 'tap' of undefined

See original GitHub issue

Trying to use this plugin with vue and electron but if try to use the electron:serve the console will log this error

vue-cli-service electron:serve
 INFO  Starting development server...

<s> [webpack.Progress] 0% compiling

 ERROR  TypeError: Cannot read property 'tap' of undefined
TypeError: Cannot read property 'tap' of undefined
    at /Users/lab/Sites/fil/electron-app/node_modules/webpack-obfuscator/dist/plugin/index.js:25:45
    at SyncHook.eval (eval at create (/Users/lab/Sites/fil/electron-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:19:1)
    at SyncHook.lazyCompileHook (/Users/lab/Sites/fil/electron-app/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.newCompilation (/Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Compiler.js:631:26)
    at /Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Compiler.js:667:29
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/lab/Sites/fil/electron-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/lab/Sites/fil/electron-app/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.compile (/Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Compiler.js:662:28)
    at /Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Watching.js:77:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/lab/Sites/fil/electron-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/lab/Sites/fil/electron-app/node_modules/tapable/lib/Hook.js:154:20)
    at Watching._go (/Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Watching.js:41:32)
    at /Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Watching.js:33:9
    at Compiler.readRecords (/Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Compiler.js:529:11)
    at new Watching (/Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Watching.js:30:17)
    at Compiler.watch (/Users/lab/Sites/fil/electron-app/node_modules/webpack/lib/Compiler.js:244:10)

This is the vue.config.js file I’m using

const WebpackObfuscator = require('webpack-obfuscator');

module.exports = {
  configureWebpack: {
    plugins: [
      new WebpackObfuscator({
        rotateStringArray: true,
        debugProtection: true,
        disableConsoleOutput: true,
        selfDefending: true,
        stringArrayWrappersType: 'function'
      })
    ]
  },
  pluginOptions: {
    electronBuilder: {
      builderOptions: {
        appId: "com.realrecordzlab.fil",
        copyright: "Copyright © 2020 realrecordzLab",
        artifactName: "${name}-${version}-${os}.${ext}",
        asar: true,
        mac: {
          target: {
            target: "dmg"
          },
          icon: "build/icon.icns",
        },
        win: {
          icon: "build/icon.icns"
        }
      },
      outputDir: "build",
      preload: "src/preload.js"
    }
  }
}

Is possible to fix this problem?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
cnscorpionscommented, Dec 14, 2020

@sanex3339 , thank you, I will have a try. 😁

2reactions
sanex3339commented, Dec 14, 2020

Hi. For webpack@4 use latest webpack-obfuscator@2.6.0 For webpack@5 - 3.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'tap' of undefined #5781
I need to install webpack for react-styleguidist, but it seems if the version doesn't match the one Next is using this error occurs....
Read more >
ProgressPlugin TypeError: Cannot read property 'tap' of ...
In my case the error was that I put a plugin under resolve.plugins , instead of directly in plugins inside the webpack config....
Read more >
Cannot read property 'tap' of undefined in ts-loader #14157
Describe the bug. Module build failed (from ./node_modules/ts-loader/index.js): TypeError: Cannot read property 'tap' of undefined. To Reproduce ...
Read more >
TypeError: Cannot read property 'tap' of undefined - 掘金
执行打包操作时报错;原因:html-webpack-plugin 插件版本安装不兼容解决方法: 安装html-webpack-plugin 版本为4.5.0.
Read more >
Webpack: Cannot read property 'tap' of undefined-Reactjs
Coding example for the question React- Webpack: Cannot read property 'tap' of undefined-Reactjs.
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