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

TypeError: Cannot read properties of undefined (reading 'ignore') #136

Open
achintha-weerasinghe opened this issue Mar 7, 2022 · 9 comments

Comments

@achintha-weerasinghe
Copy link

Started a fresh vue3 project.

Installed the plugin using vue add browser-extension

Then I ran the serve script which is vue-cli-service build --mode development --watch
I also tried vue-cli-service build as well withoud the additional flags. But got the same error.

But I got the following error.

TypeError: Cannot read properties of undefined (reading 'ignore')
    at D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\vue-cli-plugin-browser-extension\index.js:129:20
    at Object.tap (D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\webpack-chain\src\Plugin.js:30:24)
    at D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\vue-cli-plugin-browser-extension\index.js:128:36
    at D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\@vue\cli-service\lib\Service.js:268:40
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\@vue\cli-service\lib\Service.js:268:26)
    at PluginAPI.resolveChainableWebpackConfig (D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\@vue\cli-service\lib\PluginAPI.js:145:25)
    at module.exports (D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\@vue\cli-service\lib\commands\build\resolveAppConfig.js:9:22)
    at build (D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\@vue\cli-service\lib\commands\build\index.js:147:50)
    at D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\@vue\cli-service\lib\commands\build\index.js:69:13
    at Service.run (D:\office\projects\onetouch\otb-browser-ext\otb-chrome-vue\extension\node_modules\@vue\cli-service\lib\Service.js:262:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.

Expected behavior
Build the project without any errors

Temporary solution
Change the node_modules/vue-cli-plugin-browser-extension/index.js line 129
from
args[0][0].ignore.push('browser-extension.html')
to
args[0][0]?.ignore.push('browser-extension.html')

Name Version
vue-cli-plugin-browser-extension 0.25.2
Operating System Windows
Node 16.13.0
NPM/Yarn yarn
vue-cli 5.0.1
@subhod-i
Copy link

subhod-i commented Mar 9, 2022

Facing the same error on Mac M1.

@jmc529
Copy link

jmc529 commented Mar 11, 2022

Same here on Manjaro

@Kalki5
Copy link

Kalki5 commented Mar 17, 2022

This issue is tracked here.
#126

@HipsterSantos
Copy link

HipsterSantos commented Mar 27, 2022

one way to fix this is how @madumal7 mentioned or comment the line . But by doing this it'll still throwing error.
this project is not the great way to go , when it comes to manifest 3

@leoplct
Copy link

leoplct commented Jun 23, 2022

Same error.
This problem blocks our development. How can we use standard webpack code to achieve similar results?

@leoplct
Copy link

leoplct commented Jun 23, 2022

Replacing with this in package.json solved the issue

"vue-cli-plugin-browser-extension": "npm:@rhilip/vue-cli-plugin-browser-extension@^0.26.0",

@PerryDP
Copy link

PerryDP commented Jul 29, 2022

Same error.

@stephenpaulraj
Copy link

Replacing with this in package.json solved the issue

"vue-cli-plugin-browser-extension": "npm:@rhilip/vue-cli-plugin-browser-extension@^0.26.0",

this works..

@sidnaik03
Copy link

sidnaik03 commented Jan 3, 2023

Replacing with this in package.json solved the issue

"vue-cli-plugin-browser-extension": "npm:@rhilip/vue-cli-plugin-browser-extension@^0.26.0",

I am using vue 2. In package.json I put same line of code but I am getting errror as below
Error: Cannot find module 'vue-cli-plugin-browser-extension'
Please help.

My package.json

{
"name": "browserexttest",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service build --mode development --watch",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@rhilip/vue-cli-plugin-browser-extension": "^0.27.0",
"core-js": "^3.8.3",
"vue": "^2.6.14"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"vue-cli-plugin-browser-extension": "npm:@rhilip/vue-cli-plugin-browser-extension@^0.27.0",
"vue-template-compiler": "^2.6.14"
},
"eslintConfig": {
"root": true,
"env": {
"node": true,
"webextensions": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

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

9 participants