Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis ci build failure due to @vue/babel-preset-app/index.js provided an invalid property of "default" #4122

Closed
oGsLP opened this issue Jun 8, 2019 · 6 comments

Comments

@oGsLP
Copy link

oGsLP commented Jun 8, 2019

Version

3.8.0

Reproduction link

https://github.com/oGsLP/latios

Environment info

System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 8.11.4 - F:\NodeJS\node.EXE
    Yarn: 1.16.0 - F:\nvs\npm-global\yarn.CMD
    npm: 6.9.0 - F:\NodeJS\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.0.0
    @vue/babel-preset-app:  3.8.0 (3.0.0-beta.11)
    @vue/babel-preset-jsx:  1.0.0
    @vue/babel-sugar-functional-vue:  1.0.0
    @vue/babel-sugar-inject-h:  1.0.0
    @vue/babel-sugar-v-model:  1.0.0
    @vue/babel-sugar-v-on:  1.0.0
    @vue/cli-overlay:  3.8.0
    @vue/cli-plugin-babel: ^3.8.0 => 3.8.0
    @vue/cli-plugin-eslint: ^3.8.0 => 3.8.0
    @vue/cli-plugin-unit-jest: ^3.8.0 => 3.8.0
    @vue/cli-service: ^3.8.0 => 3.8.0
    @vue/cli-shared-utils:  3.8.0
    @vue/component-compiler-utils:  2.6.0
    @vue/eslint-config-prettier: ^4.0.1 => 4.0.1
    @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
    babel-helper-vue-jsx-merge-props:  2.0.3
    babel-plugin-transform-vue-jsx:  4.0.1
    eslint-plugin-vue: ^5.2.2 => 5.2.2 (4.7.1)
    jest-serializer-vue:  2.0.2
    vue: ^2.6.10 => 2.6.10
    vue-eslint-parser:  5.0.0 (2.0.3)
    vue-highlightjs: ^1.3.3 => 1.3.3
    vue-hot-reload-api:  2.3.3
    vue-jest:  3.0.4
    vue-loader:  15.7.0
    vue-router:  3.0.6
    vue-server-renderer:  2.6.10
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
    vuepress: ^0.14.11 => 0.14.11
    vuepress-html-webpack-plugin:  3.2.0
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

npm install
npm test

What is expected?

When I run npm test on my pc , everything works well. But on Travis CI it failed, it seemed to be related to @vue/babel-preset-app, but I don't know how to fix it. And I can't find similar problems online.

What is actually happening?

> vue-cli-service test:unit
 FAIL  src/components/button/button.spec.js
  ● Test suite failed to run
    Plugin 1 specified in "/home/travis/build/oGsLP/latios/node_modules/@vue/babel-preset-app/index.js" provided an invalid property of "default" (While processing preset: "/home/travis/build/oGsLP/latios/node_modules/@vue/babel-preset-app/index.js")
      at Plugin.init (node_modules/jest-config/node_modules/babel-core/lib/transformation/plugin.js:131:13)
          at Array.map (<anonymous>)
          at Array.map (<anonymous>)
 FAIL  tests/unit/test.spec.js
  ● Test suite failed to run
    Plugin 1 specified in "/home/travis/build/oGsLP/latios/node_modules/@vue/babel-preset-app/index.js" provided an invalid property of "default" (While processing preset: "/home/travis/build/oGsLP/latios/node_modules/@vue/babel-preset-app/index.js")
      at Plugin.init (node_modules/jest-config/node_modules/babel-core/lib/transformation/plugin.js:131:13)
          at Array.map (<anonymous>)
          at Array.map (<anonymous>)
@oGsLP oGsLP changed the title When I run npm test on my pc , everything works well. But on Travis CI it failed, it seemed to be related to @vue/babel-preset-app, but I don't know how to fix it. And I can't find similar problems online. Travis ci build failure due to @vue/babel-preset-app/index.js provided an invalid property of "default" Jun 8, 2019
@sodatea
Copy link
Member

sodatea commented Jun 9, 2019

Seems your travis environment has an outdated cache. What about clearing the cache and try again? (follow the instructions in https://www.garyng.xyz/gtil-gitbook/Travis/travis-ci-clear-dependencies-cache.html)
Also, don't upgrade to core-js 3 as it's only compatible with @vue/babel-preset-app v4 alpha.

@oGsLP
Copy link
Author

oGsLP commented Jun 10, 2019

I checked my repo on travis but found no cache, and both core-js 2/3 failed. Still the same problem.
Here are my dependencies

"dependencies": {
    "core-js": "^2.6.9",
    "vue": "^2.6.10",
    "vue-highlightjs": "^1.3.3"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.8.0",
    "@vue/cli-plugin-eslint": "^3.8.0",
    "@vue/cli-plugin-unit-jest": "^3.8.0",
    "@vue/cli-service": "^3.8.0",
    "@vue/eslint-config-prettier": "^4.0.1",
    "@vue/test-utils": "1.0.0-beta.29",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^24.8.0",
    "chai": "^4.2.0",
    "coveralls": "^3.0.4",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.2.2",
    "lint-staged": "^8.2.0",
    "node-sass": "^4.12.0",
    "sass-loader": "^7.1.0",
    "vue-template-compiler": "^2.6.10",
    "vuepress": "^0.14.11"
  }

And travis build logging

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @babel/preset-stage-2@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-decorators@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-decorators@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-export-namespace-from@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-function-sent@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-numeric-separator@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-throw-expressions@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/preset-stage-3@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-async-generator-functions@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-class-properties@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-object-rest-spread@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-optional-catch-binding@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-unicode-property-regex@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-dynamic-import@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-async-generators@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-object-rest-spread@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-optional-catch-binding@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-export-namespace-from@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-function-sent@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-numeric-separator@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-throw-expressions@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-import-meta@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-class-properties@7.0.0-beta.47 requires a peer of @babel/core@7.0.0-beta.47 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 2377 packages from 1291 contributors and audited 63324 packages in 55.565s
found 68 vulnerabilities (64 low, 2 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

Should I install @babel/core@7.0.0-beta.47? But when I replace babel-core@7.0.0-bridge.0 with it, jest or babel-jest can't work.

@sodatea
Copy link
Member

sodatea commented Jun 11, 2019

I guess it might be caused by vuepress 0.14 introducing conflicting peer dependencies and npm failed to handle it.
What about upgrading it to 1.x and try again?

@oGsLP
Copy link
Author

oGsLP commented Jun 11, 2019

Just now I upgrade my vuepress version and it vanish travis building warning, but when it runs npm test, it reports the same problem.

@sodatea
Copy link
Member

sodatea commented Jun 11, 2019

Ah got it. Your unit tests weren't set up by vue add @vue/cli-plugin-unit-jest, right? The dependency versions are wrong. @vue/cli-plugin-unit-jest v3 is only compatible with Jest 23. You need to downgrade babel-jest.

@sodatea sodatea closed this as completed Jun 11, 2019
@oGsLP
Copy link
Author

oGsLP commented Jun 11, 2019

ahh, it does work well. Thank you very much. You're far too kind and patient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants