nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
22.02k stars 1.54k forks source link

[BUG] - Dropdown component causes ChunkLoadError in app/layout #4096

Open dberruezo opened 2 days ago

dberruezo commented 2 days ago

NextUI Version

@nextui-org/dropdown@2.1.31

Describe the bug

I'm using Next.js v14.2.16 and Node v20, also tried with Node v18. NextUI was installed using the manual installation instructions and installed component packages separatedly instead of @nexui-org/react.

All of the NextUI components are used in client components with its corresponding 'use client'; statement.

Using the recommended setup, using providers and such, I've no problems using the Button, Input and Card components so far. However when declaring and using a Dropdown component then run the development server, the first render will yield a ChunkErrorLoad app/layout error and the deployed app will not function correctly. After reloading the page it will function correctly. This also happens in production, after building and serving the app.

After isolating all other components and libraries used in the app and then adding one by one the culprit seems to be the Dropdown component. When removing the component the application works without issues and the ChunkErrorLoad error dissapears.

The error is the following: ChunkLoadError: Loading chunk app/layout failed. (timeout: http://localhost:3000/_next/static/chunks/app/layout.js)

UPDATE: Seems to also happening when using Link components.

Your Example Website or App

https://github.com/dberruezo/nextui-dropdown-bug

Steps to Reproduce the Bug or Issue

  1. npx create-next-app@14 a. Use src/ directory and app router. Do not use turbopack.
  2. Use the https://nextui.org/docs/guide/installation#individual-installation instructions
  3. Use a providers component.
  4. Create a Dropdown, don't forget the 'use client' directive.
  5. npm run dev (remember, no turbopack)
  6. Open a clean browser tab, inspect it, fire up the local URL and watch the console.
  7. Wait for a couple minutes then the NextJS error shows up.

Expected behavior

The app should not have a ChunkLoadError at start.

Screenshots or Videos

No response

Operating System Version

Kubuntu 24.04

Browser

Chrome

linear[bot] commented 2 days ago

ENG-1567 [BUG] - Dropdown component causes ChunkLoadError in app/layout