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

Chakra UI set up is incompatible with initial project template #5601

Closed
djaustin opened this issue May 20, 2022 · 3 comments · Fixed by #5614
Closed

Chakra UI set up is incompatible with initial project template #5601

djaustin opened this issue May 20, 2022 · 3 comments · Fixed by #5614
Assignees

Comments

@djaustin
Copy link

Creating a new project with yarn create redwood-app <name> followed by setting up the project with Chakra UI causes errors in the web project.

It seems that the version of Chakra being installed by the setup CLI is dependent on useId from React which was only introduced in React 18.

Upgrading React to version 18 in the web project seems to resolve this.

Steps to reproduce

  1. yarn create redwood-app chakra-test
  2. cd chakra-test
  3. yarn rw setup ui chakra-ui
  4. yarn rw dev

Expected outcome

The Redwood welcome page is displayed

Actual outcome

An error is thrown

Uncaught TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.startTransition) is not a function
    at ref (chakra-ui-react-env.esm.js:137:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at safelyDetachRef (react-dom.development.js:20435:1)
    at commitUnmount (react-dom.development.js:20959:1)
    at commitNestedUnmounts (react-dom.development.js:21004:1)
    at unmountHostComponents (react-dom.development.js:21290:1)
    at commitDeletion (react-dom.development.js:21347:1)
    at commitMutationEffects (react-dom.development.js:23407:1)

image

@jtoar jtoar added this to Main May 20, 2022
@jtoar jtoar moved this to Triage in Main May 20, 2022
@callingmedic911
Copy link
Member

We're discussing this here: #5570 (comment)

As a temporary workaround, you can change this line in web/package.json:

-"@chakra-ui/react": "^2.0.2",
+"@chakra-ui/react": "^1.3.0",

Repository owner moved this from Triage to Done in Main May 20, 2022
@zygopleural
Copy link
Contributor

As a temporary workaround, you can change this line in web/package.json:

-"@chakra-ui/react": "^2.0.2",
+"@chakra-ui/react": "^1.3.0",

Error: @chakra-ui/react@npm:1.3.0: No candidates found

FYI for anyone coming here, I got this working with:

-"@chakra-ui/react": "^2.0.2",
+"@chakra-ui/react": "^1.8.8",

Full config:

"dependencies": {
  "@chakra-ui/icons": "^2.0.0",
  "@chakra-ui/react": "^1.8.8",
  ...
},
"devDependencies": {
  "@chakra-ui/storybook-addon": "^1.0.3"
}

@Philzen
Copy link
Contributor

Philzen commented May 30, 2022

Is there already an upgrade plan to React 18 or are there any showstoppers for that?

Asking b/c we would love to update our existing project to Chakra UI 2.x to utilize the new storybook addon.

@redwoodjs-bot redwoodjs-bot bot moved this from Done to Archived in Main Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Archived
Development

Successfully merging a pull request may close this issue.

4 participants