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

fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system #18686

Merged
merged 2 commits into from
Nov 1, 2021

Conversation

ZachJW34
Copy link
Contributor

@ZachJW34 ZachJW34 commented Oct 28, 2021

User facing changelog

cypress/react/plugins/next will throw if using Next.js 12 SWC optimizations without having "nodeVersion": system in cypress config

Additional details

With Next.js v12, javascript/typescript is compiled with SWC by default. When compiling with Cypress, the build will fail unless "nodeVersion": "system" is configured due to how Cypress' version of node can't sign the swc package.
Screen Shot 2021-10-27 at 1 05 26 PM

This is a stop-gap until "node-version": "system" becomes the default. #18684

How has the user experience changed?

Users that are using Next.js v12 with SCW optimizations that have not added "nodeVersion": "system" to their cypress config will have their build fail with a message telling the user how to fix the issue.

Testing

I tested this by creating a fresh create-next-app and using the build result of yarn workspace @cypress/react build. Here is a branch within the cypress-component-testing-examples repo. You have to copy the content of both npm/react/dist and npm/react/plugins into your local node_modules @cypress/react to test the new code. Rust optimizations can be enabled by deleting the .babelrc.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 28, 2021

Thanks for taking the time to open a PR!

@ZachJW34 ZachJW34 force-pushed the next-12-throw-without-nodeVersion-system branch from 4f569a8 to 7a1127c Compare October 28, 2021 16:42
@cypress
Copy link

cypress bot commented Oct 28, 2021



Test summary

4208 0 50 2Flakiness 1


Run details

Project cypress
Status Passed
Commit 642926c
Started Oct 28, 2021 7:28 PM
Ended Oct 28, 2021 7:39 PM
Duration 10:43 💡
OS Linux Debian - 10.9
Browser Electron 93

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@ZachJW34 ZachJW34 requested a review from a team as a code owner October 28, 2021 18:11
@ZachJW34 ZachJW34 requested review from jennifer-shehane and removed request for a team October 28, 2021 18:11
@ZachJW34 ZachJW34 force-pushed the next-12-throw-without-nodeVersion-system branch from 74b08a0 to 642926c Compare October 28, 2021 18:59
@jennifer-shehane jennifer-shehane requested a review from a team October 28, 2021 20:54
Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@ZachJW34 ZachJW34 merged commit d274a5b into master Nov 1, 2021
@ZachJW34 ZachJW34 deleted the next-12-throw-without-nodeVersion-system branch November 1, 2021 18:04
tgriesser added a commit that referenced this pull request Nov 3, 2021
* develop: (40 commits)
  fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441)
  chore: make `create` function on server.ts obsolete (#18615)
  docs: Add instructions to squash commits to develop in Contributing (#18728)
  fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686)
  refactor: remove Ramda (#18723)
  chore: Increase paralleled machines for desktop-gui tests (#18725)
  chore: Update Chrome (stable) to 95.0.4638.69 (#18696)
  chore: release @cypress/vue-v3.0.4
  chore: release @cypress/react-v5.10.2
  chore: release @cypress/schematic-v1.5.3
  fix: remove outdated registry link (#18710)
  chore: release @cypress/schematic-v1.5.2
  chore: release create-cypress-tests-v1.1.3
  chore: Update Chrome (beta) to 96.0.4664.27 (#18676)
  chore(tests): Remove flaky assertion that relies on png how compression (#18668)
  fix: make sure to go back to no-specs when delete spec file (#17760)
  fix: Next.JS 12 components testing failing with ` TypeError: Cannot read property 'traceChild' of undefined` (#18648)
  Backport .gitignore from unified-desktop-gui
  chore(docs): add 'Upgrading Electron' instructions (#18594)
  release 8.7.0 [skip ci]
  ...
tgriesser added a commit that referenced this pull request Nov 3, 2021
* develop: (40 commits)
  fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441)
  chore: make `create` function on server.ts obsolete (#18615)
  docs: Add instructions to squash commits to develop in Contributing (#18728)
  fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686)
  refactor: remove Ramda (#18723)
  chore: Increase paralleled machines for desktop-gui tests (#18725)
  chore: Update Chrome (stable) to 95.0.4638.69 (#18696)
  chore: release @cypress/vue-v3.0.4
  chore: release @cypress/react-v5.10.2
  chore: release @cypress/schematic-v1.5.3
  fix: remove outdated registry link (#18710)
  chore: release @cypress/schematic-v1.5.2
  chore: release create-cypress-tests-v1.1.3
  chore: Update Chrome (beta) to 96.0.4664.27 (#18676)
  chore(tests): Remove flaky assertion that relies on png how compression (#18668)
  fix: make sure to go back to no-specs when delete spec file (#17760)
  fix: Next.JS 12 components testing failing with ` TypeError: Cannot read property 'traceChild' of undefined` (#18648)
  Backport .gitignore from unified-desktop-gui
  chore(docs): add 'Upgrading Electron' instructions (#18594)
  release 8.7.0 [skip ci]
  ...
tgriesser added a commit that referenced this pull request Nov 4, 2021
…ve-activeProject

* unified-desktop-gui: (57 commits)
  chore: Add e2e tests for global mode (#18719)
  chore: add percy to app and launchpad package (#18781)
  chore: update test
  refactor: move settings in app (#18729)
  feat: setup launchpad lifecycle (#18734)
  feat(app): decouple event manager from driver (#18695)
  chore: Force single resolution for core modules, infinite loop guard (#18764)
  fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441)
  chore: cleaning up the runner container pattern (#18741)
  feat: Use .config files (#18578)
  chore(app): basic style and example to stop scrollIntoView bug (#18736)
  chore: make `create` function on server.ts obsolete (#18615)
  feat: add codegen utility (#18708)
  docs: Add instructions to squash commits to develop in Contributing (#18728)
  fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686)
  refactor: remove Ramda (#18723)
  fix: support using create-cypress-tests as part of build process (#18714)
  chore: Increase paralleled machines for desktop-gui tests (#18725)
  fix(app): do not cache graphql (#18716)
  chore: Update Chrome (stable) to 95.0.4638.69 (#18696)
  ...
flotwig pushed a commit that referenced this pull request Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants