Home > Blockchain >  Unable to add a new dependency to Vue 3 project
Unable to add a new dependency to Vue 3 project

Time:11-27

I installed a new package "vue-full-loading" to my project. It gives me an error if I reference the package

import loading from "vue-full-loading";

and build using vite. Any idea on what this error means ? Thank you!

Unexpected token.

if (isReadonly(target)) {
process.env.NODE_ENV !== 'production' && warn("Set operation on key \"".concat(key, "\" 
failed: target is readonly."));
                           ^
return;
}

Below are the dependencies I have.

"dependencies": {
"axios": "^1.1.3",
"bootstrap": "^5.2.2",
"bootstrap-vue": "^2.22.0",
"pinia": "2.0.23",
"vue": "3.2.41",
"vue-router": "4.1.5",
"vue-full-loading": "^1.2.1"
},
"devDependencies": {
"@vitejs/plugin-vue": "3.1.2",
"vite": "3.1.8"
}

CodePudding user response:

vue-full-loader was last updated 5 years ago according to npm - it's highly unlikely it would be compatible with the latest version of Vue, which is what you're running. The package will likely have to be updated to use with Vue 3. If you have the option you may want to try it with an earlier version of Vue, but I would recommend looking for an alternative.

Here is a similar package that has been updated in the last month or so: https://www.npmjs.com/package/vue-loading-overlay

  • Related