Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed Jul 14, 2022
1 parent 58c4795 commit 7ddf1d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion npm/vite-dev-server/src/plugins/react18.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,22 @@ export const React18 = (projectRoot: string): Plugin => {
transform (code, id) {
const isUsingLegacyApi = usingReactWithLegacyAPI(projectRoot)

debug('is using legacy react version? %s', isUsingLegacyApi)

if (!isUsingLegacyApi) {
return
}

// TODO: Why do we need to check against cypress-react (dev mode, system tests)
// AND cypress_react (production)?
const isCypressReact = ['cypress-react.esm-bundler.js', 'cypress_react.js'].includes(id)
const isCypressReact = id.includes('cypress-react.esm-bundler.js') || id.includes('cypress_react.js')

debug('is request cypress/react', isCypressReact)

if (isCypressReact) {
// remove problematic code via transform!
debug('transforming cypress/react to remove react-dom/client for backwards compat')

return code.replace('react-dom/client', 'react-dom')
}
},
Expand Down

2 comments on commit 7ddf1d4

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7ddf1d4 Jul 14, 2022

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.1/linux-x64/lmiller/21381-react-18-with-ignore-7ddf1d4b4135e5d7090a17a2993bd5470a28dace/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 7ddf1d4 Jul 14, 2022

Choose a reason for hiding this comment

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

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-arm64/lmiller/21381-react-18-with-ignore-7ddf1d4b4135e5d7090a17a2993bd5470a28dace/cypress.tgz

Please sign in to comment.