question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading chakra-ui/react from v2.3.4 to v2.3.5 breaks vitest

See original GitHub issue

Description

When I upgrade chakra-ui/react from v2.3.4 to v2.3.5 it breaks vitest

Link to Reproduction

https://github.com/saifbechan/nextjs-ts-eslint-chakraui-vitest-playwright

Steps to reproduce

  1. Check out the repository
  2. Run yarn
  3. Run yarn test
  4. Everything works fine
  5. Upgrade chakra-ui/react to 2.3.5
  6. Run yarn test
  7. You will get the following error
  8. ReferenceError: Cannot access '__vite_ssr_import_5__' before initialization

Chakra UI Version

2.3.5

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:17
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
itkrt2ycommented, Oct 19, 2022

This looks like a vite’s bug. https://github.com/vitejs/vite/issues/10444 You can fix vitest by deps.fallbackCJS = true for now. https://vitest.dev/config/#deps-fallbackcjs

4reactions
LizardLiangcommented, Nov 21, 2022

I have my package setup like this image

and my vite,config,ts like this image

still having the same problem image

Does anyone have a fix for this?

thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading to v2
Chakra UI v2 is focused on providing compatibility for React 18. Doing so we had to introduce some breaking changes. That lead us...
Read more >
Version 2.3.4 - Chakra UI
Explore the changelog for Chakra UI version 2.3.4. Learn about the latest features, bug fixes, and improvements.
Read more >
Version 2.3.3 - Chakra UI
Explore the changelog for Chakra UI version 2.3.3. Learn about the latest features, bug fixes, and improvements.
Read more >
Version 2.3.5
Version 2.3.5. v2.3.5. Minor Changes#. Tooltip 2.2.0 #. Added closeOnScroll prop to allow closing tooltip when the page or overflow container scrolls.
Read more >
Version 2.4.3 - Chakra UI
Version 2.4.3. v2.4.3 ... Removed defaultProps from components to support React 18.3.0 ... Update modal a11y unit tests to correctly cover the portal....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found