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

React 17 support is broken in 2.57.0 build #6677

Closed
2 tasks done
tom-youd opened this issue Jan 9, 2025 · 0 comments
Closed
2 tasks done

React 17 support is broken in 2.57.0 build #6677

tom-youd opened this issue Jan 9, 2025 · 0 comments
Assignees
Labels
Sev 2 Aspects of design is broken and impedes users in a significant way, but has workaround. type: bug 🐛 Something isn't working

Comments

@tom-youd
Copy link
Contributor

tom-youd commented Jan 9, 2025

Package

Carbon for IBM Products

Description

We've noticed that React 17 support is broken in the latest build.
There are a couple of unit tests we have with Enzyme and when we render a component we get the following error TypeError: React.useInsertionEffect is not a function.

Similar to #6672, the stack trace shows that the framer-motion is calling React.useInsertionEffect which is not part of the React 17 API.

Stack trace is as follows

at useVisualElement (node_modules/@carbon/ibm-products/node_modules/framer-motion/dist/cjs/index.js:10142:11)
      at MotionComponent (node_modules/@carbon/ibm-products/node_modules/framer-motion/dist/cjs/index.js:10264:37)
      at ReactShallowRenderer.render (node_modules/react-shallow-renderer/cjs/react-shallow-renderer.js:854:53)
      at renderElement (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:559:41)
      at renderElement (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:642:44)
      at fn (node_modules/@wojtekmaj/enzyme-adapter-utils/src/Utils.js:85:18)
      at Object.render (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:642:37)
      at new render (node_modules/enzyme/src/ShallowWrapper.js:411:22)
      at ShallowWrapper.wrap (node_modules/enzyme/src/ShallowWrapper.js:1668:5)
      at ShallowWrapper.wrap (node_modules/enzyme/src/ShallowWrapper.js:1713:19)
      at ShallowWrapper.call [as single] (node_modules/enzyme/src/ShallowWrapper.js:1654:21)
      at ShallowWrapper.single [as dive] (node_modules/enzyme/src/ShallowWrapper.js:1704:17)
      at Object.dive (src/client/components/Form/CanvasSlideOver/CanvasSlideOver.spec.js:359:40)

When we revert back to 2.56.1 everything works as expected.

Looking at framer-motion package it looks like 6.5.1 is the last version which is supported for React 17

Component(s) impacted

Any component which depends on framer-motion

Browser

No response

@carbon/ibm-products (previously @carbon/ibm-cloud-cognitive) version

2.57.0

Suggested Severity

Severity 2 = Aspects of design is broken, and impedes users in a significant way, but there is a way to complete their tasks. Affects major functionality, has a workaround.

Product/offering

Cloud Pak for Integration

CodeSandbox or Stackblitz example

n/a

Steps to reproduce the issue (if applicable)

No response

Release date (if applicable)

No response

Code of Conduct

@github-project-automation github-project-automation bot moved this to Needs triage 🧐 in Carbon for IBM Products Jan 9, 2025
@matthewgallo matthewgallo added type: bug 🐛 Something isn't working Sev 2 Aspects of design is broken and impedes users in a significant way, but has workaround. and removed status: needs triage 🕵️‍♀️ labels Jan 9, 2025
@matthewgallo matthewgallo moved this from Needs triage 🧐 to In progress in Carbon for IBM Products Jan 9, 2025
@AlexanderMelox AlexanderMelox moved this from In progress to In review 👀 in Carbon for IBM Products Jan 9, 2025
@github-project-automation github-project-automation bot moved this from In review 👀 to Done 🚀 in Carbon for IBM Products Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sev 2 Aspects of design is broken and impedes users in a significant way, but has workaround. type: bug 🐛 Something isn't working
Projects
Status: Done 🚀
Development

No branches or pull requests

3 participants