-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress Component test crashes after empty vue.config.js is added. #23896
Comments
Debug Logs were too long to add, so I add them as response:
|
Thanks for the info @msebas, I was able to reproduce the error with the information you provided. I suspect the issue is coming from our use of the vue-cli -> resolveWebpackConfig (we rely on this to get the Webpack config) and your use of Though this seems like an edge-case (only happens when In terms of a fix, I could see it happen on both our end or we create an issue with const Service = require('@vue-cli-service/lib/service')
const service = new Service(...)
await service.init(...)
const webpackConfig = service.resolveWebpackConfig() A workaround if you don't require Let me know if the workaround works for you! |
Also, if you're interested in contributing a fix for this that would be most welcome! The relevant code can be found here |
@ZachJW34: I made a pull request with the fix you proposed for the cypress side. Any fix on the vue-cli side seems to be complicated. My approach would be to return a function in Here is the content of the modified
|
Current behavior
If I add an empty
vue.config.js
to the project described below./node_modules/.bin/cypress run --component
fails to compile givingas error message.
I tried to debug it and found that the configurations of webpack with and without a
vue.config.js
differ. My knowledge about webpack is quite limited, but for me it seems like theplugins
configuration is missing critical options, themodule.rules
are empty andmodule.noParse
is undefined. On top are the output directories different.I made a screenshot of the evaluations (
this
is in both cases the webpack compiler instance, left is the version withoutvue.config.js
that works).Desired behavior
Cypress should run with and without an empty
vue.config.js
present.Test code to reproduce
src/components/HelloWorld.cy.ts
:src/components/HelloWorld.vue
:cypress.config.ts
:package.json
:tsconfig.js
:vue.config.js
is emptycypress/support/commands.ts
is emptycypress/support/component.ts
:Cypress Version
10.8.0
Node version
16.13.1
Operating System
openSuSE 15.2
Debug Logs
No response
Other
Any hints or solutions are greatly appreciated.
If there is anything missing or any questions arise please ask.
The text was updated successfully, but these errors were encountered: