vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Upgrading to 4.05 cause tests to break #4796

Closed mspoulsen closed 4 years ago

mspoulsen commented 5 years ago

Version

4.0.5

Environment info

System:
    OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
    CPU: (8) x64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
  Binaries:
    Node: 10.12.0 - ~/.nvm/versions/node/v10.12.0/bin/node
    Yarn: Not Found
    npm: 6.9.2 - ~/.nvm/versions/node/v10.12.0/bin/npm
  Browsers:
    Chrome: 77.0.3865.90
    Firefox: 68.0
  npmPackages:
    @kazupon/vue-i18n-loader:  0.3.0 
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0 
    @vue/babel-preset-app:  4.0.5 
    @vue/babel-preset-jsx:  1.1.1 
    @vue/babel-sugar-functional-vue:  1.0.0 
    @vue/babel-sugar-inject-h:  1.0.0 
    @vue/babel-sugar-v-model:  1.1.1 
    @vue/babel-sugar-v-on:  1.1.0 
    @vue/cli-overlay:  4.0.5 
    @vue/cli-plugin-babel: ^4.0.5 => 4.0.5 
    @vue/cli-plugin-e2e-cypress: ^4.0.5 => 4.0.5 
    @vue/cli-plugin-router:  4.0.5 
    @vue/cli-plugin-typescript: ^4.0.5 => 4.0.5 
    @vue/cli-plugin-unit-jest: ^4.0.5 => 4.0.5 
    @vue/cli-plugin-vuex:  4.0.5 
    @vue/cli-service: ^4.0.5 => 4.0.5 
    @vue/cli-shared-utils:  4.0.5 
    @vue/component-compiler-utils:  3.0.1 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/test-utils: ^1.0.0-beta.29 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    aws-amplify-vue: ^0.2.14 => 0.2.14 
    cypress-vue-unit-test: ^1.11.3 => 1.11.3 
    jest-serializer-vue:  2.0.2 
    qrcode.vue:  1.6.2 
    typescript: ^3.6.2 => 3.6.2 
    vue: ^2.6.10 => 2.6.10 
    vue-autosuggest: ^2.0.2 => 2.0.2 
    vue-class-component:  7.1.0 
    vue-cleave-component: ^2.1.3 => 2.1.3 
    vue-cli-plugin-vuetify: ^2.0.1 => 2.0.1 
    vue-cli-plugin-vuex-module-generator: ^0.1.1 => 0.1.1 
    vue-clipboard2: ^0.3.0 => 0.3.0 
    vue-hot-reload-api:  2.3.4 
    vue-jest:  3.0.5 
    vue-loader:  15.7.2 
    vue-property-decorator:  8.2.2 
    vue-router: ^3.1.2 => 3.1.2 
    vue-slide-up-down: ^1.7.2 => 1.7.2 
    vue-slider-component: ^3.0.39 => 3.0.39 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vue2-filters:  0.3.0 
    vuetify: ^1.5.18 => 1.5.18 
    vuetify-loader: ^1.2.1 => 1.2.1 
    vuex: ^3.1.1 => 3.1.1 
    vuex-persistedstate: ^2.5.4 => 2.5.4 
  npmGlobalPackages:
    @vue/cli: 4.0.5

Steps to reproduce

I am in the process of upgrading from Vue Cli 3.11 to 4.05. All my (jest) unit tests and cypress e2e tests are passing before I begin. These are the steps that I take and what happens at each step:

  1. I run vue upgrade => this results in my unit tests breaking: "Passing cached plugin instances is not supported in babel.loadPartialConfig()" and my e2e tests return "No tests found in your file" (https://docs.cypress.io/guides/references/error-messages.html#No-tests-found-in-your-file)

What is expected?

I expect things to just work when I run vue upgrade?

What is actually happening?

Things break. I am able to fix my unit tests by upgrading jest manually but I have not yet found a way to fix my e2e tests.

haoqunjiang commented 5 years ago

Hi, thanks for your report. Would you please reduce your issue to a small reproducible example (e.g. a GitHub repository together with instructions on how to get to the problem)? Without a runnable example it would be difficult for us to find out what is going wrong.

mspoulsen commented 5 years ago

Unfortunately that is not possible. It is a very big (and private) project.

But the codebase is typescript, the cypress test files are javascript.

Maybe you can explain me why I need the cli-plugin-e2e-cypress in the first place? What is the difference from setting up Cypress on my own? What does it do? I find that very hard to figure out.

I am basically looking for a setup where:

  1. My main codebase is typescript
  2. My e2e test files are javascript (or even better typescript)
  3. It can run headless (which typescript + cli-plugin-e2e-cypress seems to prevent)

Is that setup possible? From what I have seen headless + typescript seems not to be possible atm?

haoqunjiang commented 5 years ago

Maybe you can explain me why I need the cli-plugin-e2e-cypress in the first place? What is the difference from setting up Cypress on my own? What does it do?

Of course, you can set up Cypress on your own. See the codebase here: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-cypress Most of the code resides in the template folder, meaning they are only used for scaffolding purposes. Nothing more. The rest are:

Also, see the commit history here: https://github.com/vuejs/vue-cli/commits/dev/packages/%40vue/cli-plugin-e2e-cypress Almost nothing has changed since v3.2. So your problem is not likely to be caused by the upgrade of the cypress plugin.


Another thing that may need notice is that in v3.2, we changed the default template to comment out the preprocessor block because it's very buggy (it was added in v3.1 to support aliases etc.). https://github.com/vuejs/vue-cli/pull/2904/files#diff-1c4d741ece51a603d9d28f55c9d1e306 So if your project still contains that piece of code, try to remove it and see if it works.

mspoulsen commented 5 years ago

Ok, thanks a lot. I just like as few dependencies as possible. Maybe it is @vue/cli-service. I only upgraded 5 dependencies - nothing else. I will keep investigating.

I know that there are problems running Cypress headlessly if typescript is in the mix but I will raise that question on cypress.io.

Thanks again for swift reply :)

vue-bot commented 5 years ago

Hello! This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues requiring feedback after 20 days of inactivity. It’s been at least 10 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. (A maintainer can also add the label not stale to keep this issue open.)

Thanks for being a part of the Vue community! 💪💚️

vue-bot commented 4 years ago

Hey again! 😸️

It’s been 20 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. 🤖 Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Vue community! 💚️