composition-api
composition-api copied to clipboard
help: Installing Composition-api on nuxt 2.15.8 throws Error
📚 What are you trying to do? Please describe. Installing composition-api on a nuxt version 2.15.8 for vue-echart I have added @nuxtjs/composition-api/module' into buildModules
🔍 What have you tried? removing the composition-api from buildModules will stop the error and return of a successfull build but the application will show a blank page untill I comment the echart plugin too
ℹ️ Additional context
Error Code
ERROR in ./client/pages/maintenance/maintenance.vue?vue&type=custom&index=0&blockType=title friendly-errors 18:35:59 Module parse failed: Unexpected token (2:5) friendly-errors 18:35:59 File was processed with these loaders: * ./node_modules/vue-loader/lib/index.js * ./node_modules/unplugin/dist/webpack/loaders/transform.js You may need an additional loader to handle the result of these loaders. | > Site Maintenance friendly-errors 18:35:59 @ ./client/pages/maintenance/maintenance.vue?vue&type=custom&index=0&blockType=title 1:0-220 1:236-239 1:241-458 1:241-458 @ ./client/pages/maintenance/maintenance.vue @ ./client/pages lazy ^\.\/.*$ namespace object @ ./client/router.js @ ./.nuxt/router.js @ ./.nuxt/index.js @ ./.nuxt/client.js @ multi ./.nuxt/composition-api/register.js ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
any help would be appreciated
me too
Would you provide a reproduction please?
+1
@danielroe I think this might be related to an issue I'm experiencing myself as well. This is my lockfile:
"node_modules/@nuxtjs/composition-api": {
"version": "0.33.1",
"resolved": "https://registry.npmjs.org/@nuxtjs/composition-api/-/composition-api-0.33.1.tgz",
"integrity": "sha512-dI0c5atKDsEIVycrsKw9T+aaos2VggscSJBPZpC1BXKzHR7+9Ilor+SHvnAEb5j2E2v+8x407Uo339oJzhlD1A==",
"dependencies": {
"defu": "^6.0.0",
"estree-walker": "^2.0.2",
"fs-extra": "^9.1.0",
"magic-string": "^0.26.2",
"pathe": "^0.3.3",
"ufo": "^0.8.5"
},
"engines": {
"node": ">=v14.13.0"
},
"peerDependencies": {
"@nuxt/vue-app": "^2.15",
"nuxt": "^2.15",
"vue": "^2.7.8"
}
},
The vue version all Nuxt packages packages are using is ^2.6.12, so there's a mismatch. Check https://github.com/jellyfin/jellyfin-vue/pull/1765 for logs
You will need to update your lockfile so the vue version is updated. You can try npm up vue-server-renderer vue-template-compiler (might need you to explicitly remove outdated versions from lockfile too).
Closing as it appears to be an issue with outdated Vue dependencies.