Closed atrunelle closed 4 years ago
The line throwing the error is in /node_modules/vue-cli-plugin-nativescript-vue/index.js:1180:9
config.module
.rule('ts')
.uses.get('ts-loader')
.get('options');
I find that vue cli plugins added in dependencies
are resolved last and it influences the order plugins are loaded. In this case, the @vue/cli-plugin-typescript
webpack config was loaded after vue-cli-plugin-nativescript-vue
and so ts-loader
was missing when vue-cli-plugin-nativescript-vue
was referring to it.
Adding vue-cli-plugin-nativescript-vue
to dependencies
as well rather than in devDependencies
solves the issue (which is what I will need to do anyway in my real project).
Closing this issue then.
Repo to reproduce
I was trying to use this plugin on my existing Vue project, which is using Vue CLI 4.
I got this error after setting it up selecting existing project and dual web and native.
I tried setting up a brand new project with TypeScript with the Vue CLI 4 and this plugin as well, and it worked fine in that case.
I manage to nail it down to the fact that my
@vue/cli-plugin-typescript
in mypackage.json
was in mydependencies
rather thandevDependencies
(as it is for a branch new project).Our sysadmin installs our packages using
npm install --production
for production deploy, and build projects just after, which is why I have that Vue CLI plugins as part ofdependencies
.I don't think this should result in an error though. Can you investigate?
Let me know if you need more info.