Skip to content

Dependency issue of @chakra-ui/react-utils with yarn berry #3774

@tomchentw

Description

@tomchentw

🐛 Bug report

ModuleNotFoundError: Module not found: Error: @chakra-ui/tooltip tried to access @chakra-ui/react-utils, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

💥 Steps to reproduce

We use yarn berry as the package manager. See the system information section below.

  1. Clone the repro: https://github.com/tomchentw/chakra-ui-repro
  2. Run yarn to install dependencies
  3. Run yarn build and see the error.

JPEG-1

💻 Link to reproduction

https://github.com/tomchentw/chakra-ui-repro

🧐 Expected behavior

Update related packages to declare @chakra-ui/react-utils as its dependency.

🌍 System information

Software Version(s)
@chakra-ui/react 1.5.0 Exact
@chakra-ui/system 1.6.1 Exact
@chakra-ui/theme 1.8.1 Exact
node v14.16.0
yarn 2.4.1

📝 Additional information

A. We could work around this by using packageExtensions to set the correct dependency:

packageExtensions:
  "@chakra-ui/clickable@*":
    dependencies:
      "@chakra-ui/react-utils": 1.1.1
  "@chakra-ui/tooltip@*":
    dependencies:
      "@chakra-ui/react-utils": 1.1.1
  "@chakra-ui/system@*":
    dependencies:
      "@chakra-ui/react-utils": 1.1.1

B. Or fixed the versions at:

"@chakra-ui/react": "1.4.0",
"@chakra-ui/system": "1.4.0",
"@chakra-ui/theme": "^1.8.1",

to defer upgrades

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions