I'm trying to build library with following command but get error "Syntax Error: TypeError: Cannot read properties of undefined (reading 'styles')":
$ vue-cli-service build --target lib --name login mod/login/Component/page.vue Response:
⠴ Building for production as library (commonjs,umd,umd-min)... ERROR Failed to compile with 1 error 11:07:40 AM error in ./mod/login/Component/page.vue Syntax Error: TypeError: Cannot read properties of undefined (reading 'styles') package.json, stripped
{ "devDependencies": { "@babel/core": "^7.12.16", "@babel/eslint-parser": "^7.12.16", "@tailwindcss/typography": "^0.5.10", "@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.7.1", "tailwindcss": "^3.4.10" }, "dependencies": { "axios": "^1.7.7", "core-js": "^3.8.3", "toastr": "^2.1.4", "vue": "^3.2.13", // installed 3.5 "vue-i18n": "^10.0.4", "vue-router": "^4.4.5" // derived dependencies // [email protected] // [email protected] }, ... } page.vue:
<script> import {defineComponent} from "vue"; export default defineComponent((vars) => { return { displayName: 'Login', components: { }, data() { return { }; } }; }); </script> <template> <main> ... </main> </template> I have tried to add to package.json resolutions to vue-loader 15, 16, 17 but no luck.