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

[BUG] - Running NextUI in a monorepo Yarn Berry environment results in an error. #3851

Open
Gaic4o opened this issue Oct 7, 2024 · 2 comments

Comments

@Gaic4o
Copy link
Contributor

Gaic4o commented Oct 7, 2024

NextUI Version

2.4.8

Describe the bug

I installed nextui in the yarn berry monorepo environment using turbo. But when I run it, an error occurs.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. install the turbo repo environment. yarn dlx create-turbo@latest
  2. migrate the monorepo environment from yarn classic to yarn berry.
  3. yarn dlx create-next-app@latest apps/my-app
  4. install a new nextui project in my-app apps. npm install @nextui-org/react framer-motion
  5. Tailwind CSS Setup and Provider Setup together.
  6. run the project with next dev.
./app/globals.css.webpack[javascript/auto]!=!../../.yarn/__virtual__/next-virtual-71db4a0ca8/4/.yarn/berry/cache/next-npm-14.2.14-ec3d370484-10c0.zip/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!../../.yarn/__virtual__/next-virtual-71db4a0ca8/4/.yarn/berry/cache/next-npm-14.2.14-ec3d370484-10c0.zip/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css
ReferenceError: nextui is not defined
Import trace for requested module:
./app/globals.css.webpack[javascript/auto]!=!../../.yarn/__virtual__/next-virtual-71db4a0ca8/4/.yarn/berry/cache/next-npm-14.2.14-ec3d370484-10c0.zip/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!../../.yarn/__virtual__/next-virtual-71db4a0ca8/4/.yarn/berry/cache/next-npm-14.2.14-ec3d370484-10c0.zip/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css
./app/globals.css
....
ReferenceError: nextui is not defined

Expected behavior

It doesn’t seem like the error is occurring due to the Turbo monorepo environment. I think the issue might be with yarn berry not being able to fetch "./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}", or perhaps the error is happening because yarn berry doesn’t use node_modules.

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Chrome

@wingkwong
Copy link
Member

please share a sandbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants