adding @vue/cli-plugin-unit-jest breaks
See original GitHub issueVersion
3.7.0
Environment info
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Binaries:
Node: 11.15.0 - /usr/local/bin/node
Yarn: Not Found
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: 74.0.3729.169
Firefox: Not Found
Safari: 12.1
npmPackages:
@vue/babel-helper-vue-jsx-merge-props: 1.0.0-beta.3
@vue/babel-plugin-transform-vue-jsx: 1.0.0-beta.3
@vue/babel-preset-app: 3.7.0
@vue/babel-preset-jsx: 1.0.0-beta.3
@vue/babel-sugar-functional-vue: 1.0.0-beta.3
@vue/babel-sugar-inject-h: 1.0.0-beta.3
@vue/babel-sugar-v-model: 1.0.0-beta.3
@vue/babel-sugar-v-on: 1.0.0-beta.3
@vue/cli-overlay: 3.7.0
@vue/cli-plugin-babel: ^3.7.0 => 3.7.0
@vue/cli-plugin-eslint: ^3.7.0 => 3.7.0
@vue/cli-plugin-typescript: ^3.7.0 => 3.7.0
@vue/cli-plugin-unit-jest: ^3.8.0 => 3.8.0
@vue/cli-service: ^3.7.0 => 3.7.0
@vue/cli-shared-utils: 3.7.0 (3.8.0)
@vue/component-compiler-utils: 2.6.0
@vue/eslint-config-prettier: ^4.0.1 => 4.0.1
@vue/eslint-config-typescript: ^4.0.0 => 4.0.0
@vue/preload-webpack-plugin: 1.1.0
@vue/test-utils: ^1.0.0-beta.29 => 1.0.0-beta.29
@vue/web-component-wrapper: 1.2.0
eslint-config-vuetify: ^0.2.0 => 0.2.0
eslint-plugin-vue: ^5.0.0 => 5.2.2 (4.7.1)
jest-serializer-vue: 2.0.2
typescript: ^3.4.3 => 3.4.5
vue: ^2.6.10 => 2.6.10
vue-class-component: ^7.1.0 => 7.1.0
vue-eslint-parser: 2.0.3 (5.0.0)
vue-hot-reload-api: 2.3.3
vue-jest: 3.0.4
vue-loader: 15.7.0
vue-property-decorator: ^8.1.1 => 8.1.1
vue-rollbar: ^1.0.0 => 1.0.0
vue-router: ^3.0.3 => 3.0.6
vue-style-loader: 4.1.2
vue-template-compiler: ^2.5.21 => 2.6.10
vue-template-es2015-compiler: 1.9.1
vuedraggable: ^2.20.0 => 2.20.0
vuetify: ^1.5.14 => 1.5.14
vuex: ^3.1.1 => 3.1.1
npmGlobalPackages:
@vue/cli: 3.7.0
Steps to reproduce
try adding @vue/cli-plugin-unit-jest: vue add @vue/cli-plugin-unit-jest
What is expected?
plugin installed and working
What is actually happening?
Plugin breaks with error message and jest doesnt work, transforming not possible.
No prompts found for @vue/cli-plugin-unit-jest WARN conflicting versions for project dependency “@vue/test-utils”:
- ^1.0.0-beta.29 injected by generator “undefined”
- 1.0.0-beta.29 injected by generator “@vue/cli-plugin-unit-jest”
Using newer version (1.0.0-beta.29), but this may cause build errors. ERROR SyntaxError: Unexpected token / in JSON at position 75 SyntaxError: Unexpected token / in JSON at position 75 at JSON.parse (<anonymous>) at api.render.files (/Users/slusnys/Workspace/equinnolab/portal/link/node_modules/@vue/cli-plugin-unit-jest/generator/index.js:118:29) at Generator.resolveFiles (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:209:13) at processTicksAndRejections (internal/process/task_queues.js:86:5) { Error: Command failed: vue invoke @vue/cli-plugin-unit-jest --$inlineOptions {}
🚀 Invoking generator for @vue/cli-plugin-unit-jest…
at makeError (/usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:278:16)
at processTicksAndRejections (internal/process/task_queues.js:86:5)
code: 1, stdout: ‘\n🚀 Invoking generator for @vue/cli-plugin-unit-jest…\n’, stderr: null, failed: true, signal: null, cmd: ‘vue invoke @vue/cli-plugin-unit-jest --$inlineOptions {}’, timedOut: false, killed: false }
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@suedar I had the same problem when
vue add @vue/cli-plugin-unit-jest
, and it seems as @sodatea mentioned that I had a brokentsconfig.json
. In my case due to a trailing/extra comma. As soon as I removed that it worked:tsconfig.json格式有问题就会,多了个逗号 http://www.kjson.com/jsoneditor/ 看json格式有没有问题可以在在线网站格式化测试下