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.

Using with app created by Vue CLI fails to build

See original GitHub issue

When I try to use webpack-obfuscator with a project created by Vue CLI, it throws an exception TypeError: Cannot read property 'tap' of undefined.

Steps to reproduce:

  1. Create an app using Vue CLI as described at https://cli.vuejs.org/
vue create my-project
# OR
vue ui

(select vue3+babel preset)

  1. Install webpack-obfuscator npm i --save-dev webpack-obfuscator javascript-obfuscator
  2. Add vue.config.js to the project root
//vue.config.js
const WebpackObfuscator = require('webpack-obfuscator');

module.exports = {
    configureWebpack: {
        plugins: [
            new WebpackObfuscator({
                rotateStringArray: true
            })
        ]
    }
}
  1. Try to build the project vue-cli-service build

These steps produce the following error:


✔  Building for production...
 ERROR  TypeError: Cannot read property 'tap' of undefined
TypeError: Cannot read property 'tap' of undefined
    at C:\Users\user\Desktop\test\test\node_modules\webpack-obfuscator\dist\plugin\index.js:25:45
    at SyncHook.eval (eval at create (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:23:1)
    at SyncHook.lazyCompileHook (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\Hook.js:154:20)
    at Compiler.newCompilation (C:\Users\user\Desktop\test\test\node_modules\webpack\lib\Compiler.js:631:26)
    at C:\Users\user\Desktop\test\test\node_modules\webpack\lib\Compiler.js:667:29
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\Hook.js:154:20)
    at Compiler.compile (C:\Users\user\Desktop\test\test\node_modules\webpack\lib\Compiler.js:662:28)
    at C:\Users\user\Desktop\test\test\node_modules\webpack\lib\Compiler.js:321:11
    at Compiler.readRecords (C:\Users\user\Desktop\test\test\node_modules\webpack\lib\Compiler.js:529:11)
    at C:\Users\user\Desktop\test\test\node_modules\webpack\lib\Compiler.js:318:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Users\user\Desktop\test\test\node_modules\webpack\lib\Compiler.js:315:19
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\user\Desktop\test\test\node_modules\tapable\lib\Hook.js:154:20)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

3reactions
SmellyTrottercommented, Nov 22, 2021

版本号使用:js-ob:2.5.0 webpack-ob:2.6.0(webpack@4)

0reactions
advissorcommented, Jan 26, 2022

Solved by installing the following version :

npm install --save-dev javascript-obfuscator@2.5.0 webpack-obfuscator@2.6.0

Solution for : Cannot read property ‘tap’ of undefined

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when creating a vue project with CLI - Stack Overflow
I'm trying to create a Vue project using the Vue CLI in Ubuntu, but keep getting the same error. I've already installed the...
Read more >
Deployment - Vue CLI
Create a new Static Site on Render, and give Render's GitHub app permission to access your Vue repo. Use the following values during...
Read more >
Vue not deploying correctly? - Netlify Support Forums
my app name is http://bigrecipebook.netlify.app and the repo that it is drawing from is GitHub - philipmjobe/recipebook_vue_app I keep ...
Read more >
On the way to Vue Js.. Create Your First project App ... - Medium
vue. we can use Vue by two ways: Install through NPM or Install through CLI. Install Vue through NPM. NPM (Node ...
Read more >
create vue cli app I got error that file or directory 'config' bot ...
Vue CLI v4.5.8 Failed to check for updates ✨ Creating project in /mnt/_work_sdb8/wwwroot/lar/VApps/v3y. Initializing git repository.
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