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

vite-dev-server specifies invalid esbuild option incremental for Vite 4.2.0 #26138

Closed
astone123 opened this issue Mar 16, 2023 · 7 comments · Fixed by #26139
Closed

vite-dev-server specifies invalid esbuild option incremental for Vite 4.2.0 #26138

astone123 opened this issue Mar 16, 2023 · 7 comments · Fixed by #26139
Assignees
Labels
CT Issue related to component testing npm: @cypress/vite-dev-server @cypress/vite-dev-server package issues

Comments

@astone123
Copy link
Contributor

Vite updated esbuild to v0.17.0 which removes the incremental build option that we set in vite-dev-server

The result is that when you try to run a Cypress test with a project that is using Vite 4.2.0, you get this error message in the logs:

[vite] error while updating dependencies:
Error: Context failed with 1 error:
/Users/adams/projects/cypress-component-testing-apps/react-vite-ts/node_modules/esbuild/lib/main.js:255:12: ERROR: Invalid option in context() call: "incremental"
    at failureErrorWithLog (/Users/adams/projects/cypress-component-testing-apps/react-vite-ts/node_modules/esbuild/lib/main.js:1636:15)
    at /Users/adams/projects/cypress-component-testing-apps/react-vite-ts/node_modules/esbuild/lib/main.js:953:16
    at responseCallbacks.<computed> (/Users/adams/projects/cypress-component-testing-apps/react-vite-ts/node_modules/esbuild/lib/main.js:697:9)
    at handleIncomingPacket (/Users/adams/projects/cypress-component-testing-apps/react-vite-ts/node_modules/esbuild/lib/main.js:752:9)
    at Socket.readFromStdout (/Users/adams/projects/cypress-component-testing-apps/react-vite-ts/node_modules/esbuild/lib/main.js:673:7)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Along with this error in the command log

Screenshot 2023-03-16 at 4.07.26 PM.png

Fix component testing with Vite by removing the now invalid incremental esbuild option and figure out how to maintain the same build behavior.

@reintroducing
Copy link

I'm still seeing this as referenced by my comment in the PR, even after upgrading all my dependencies to the latest across the board.

@astone123
Copy link
Contributor Author

@reintroducing I'll respond here too just to document, this fix has not yet been released. It will go out with the next Cypress release

@adamdehaven
Copy link

Any idea when this will be released (in which Cypress version)?

@adamdehaven
Copy link

This error is also thrown with Vite version 4.1.4 and is currently blocking our upgrade flow 😬

@reintroducing
Copy link

@adamdehaven according to the release cycle of Cypress (as referenced in the PR), it looks like it'll go out in roughly one week.

@lmiller1990
Copy link
Contributor

Yes, roughly one week. Maybe Vite 4.1.0 is better until then.

Always impressed people are able to update to quickly, something in Vite 4.2 breaks our own internal workflow, no idea what... dependency hell. Have a personal project using native ESM, no bundler, no anything - DX is meh but having only a handful of deps that hardly change is 💯

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 28, 2023

Released in 12.9.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.9.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CT Issue related to component testing npm: @cypress/vite-dev-server @cypress/vite-dev-server package issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants