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] - Attempted import error: 'calendar' is not exported from '@nextui-org/theme' #2954

Closed
marketingcashfin opened this issue May 5, 2024 · 8 comments

Comments

@marketingcashfin
Copy link

NextUI Version

2.3.6

Describe the bug

Whenever I update the package @nextui-org/react or install npm install @nextui-org/calendar, I always get an error

./node_modules/@nextui-org/calendar/dist/chunk-KHPJCHY4.mjs
Attempted import error: 'calendar' is not exported from '@nextui-org/theme' (imported as 'calendar').

Could you kindly help me fix this or if its a bug. I am upgrading from V.2.29
I have even installed npm install @nextui-org/calendar

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Upgrade from version 2.2.9 to latest version, of install npm install @nextui-org/calendar

Expected behavior

Successfully import import {DateRangePicker} from "@nextui-org/react"; and use it without getting error above

Screenshots or Videos

No response

Operating System Version

Windows

Browser

Chrome

@monster99d2
Copy link

monster99d2 commented May 5, 2024

I am having the same issue.

xxx@MacBook-Pro drm % npm run build

> [email protected] build
> next build

   ▲ Next.js 14.1.0
   - Environments: .env.local
   - Experiments (use at your own risk):
     · missingSuspenseWithCSRBailout

   Creating an optimized production build ...
Failed to compile.

./node_modules/@nextui-org/calendar/dist/chunk-KHPJCHY4.mjs
Attempted import error: 'calendar' is not exported from '@nextui-org/theme' (imported as 'calendar').

Import trace for requested module:
./node_modules/@nextui-org/calendar/dist/chunk-KHPJCHY4.mjs
./node_modules/@nextui-org/calendar/dist/index.mjs
./node_modules/@nextui-org/react/dist/index.mjs
./app/login/page.jsx

./node_modules/@nextui-org/calendar/dist/chunk-KHPJCHY4.mjs
Attempted import error: 'useProviderContext' is not exported from '@nextui-org/system' (imported as 'useProviderContext').

Import trace for requested module:
./node_modules/@nextui-org/calendar/dist/chunk-KHPJCHY4.mjs
./node_modules/@nextui-org/calendar/dist/index.mjs
./node_modules/@nextui-org/react/dist/index.mjs
./app/login/page.jsx

./node_modules/@nextui-org/calendar/dist/chunk-KHPJCHY4.mjs
Attempted import error: 'calendar' is not exported from '@nextui-org/theme' (imported as 'calendar').

Import trace for requested module:
./node_modules/@nextui-org/calendar/dist/chunk-KHPJCHY4.mjs
./node_modules/@nextui-org/calendar/dist/index.mjs
./node_modules/@nextui-org/react/dist/index.mjs
./app/login/page.jsx

./node_modules/@nextui-org/date-input/dist/chunk-D3JVNOVA.mjs
Attempted import error: 'dateInput' is not exported from '@nextui-org/theme' (imported as 'dateInput').

Import trace for requested module:
./node_modules/@nextui-org/date-input/dist/chunk-D3JVNOVA.mjs
./node_modules/@nextui-org/date-input/dist/index.mjs
./node_modules/@nextui-org/react/dist/index.mjs
./app/login/page.jsx

./node_modules/@nextui-org/date-input/dist/chunk-D3JVNOVA.mjs
Attempted import error: 'dateInput' is not exported from '@nextui-org/theme' (imported as 'dateInput').

Import trace for requested module:
./node_modules/@nextui-org/date-input/dist/chunk-D3JVNOVA.mjs
./node_modules/@nextui-org/date-input/dist/index.mjs
./node_modules/@nextui-org/react/dist/index.mjs
./app/login/page.jsx

@monster99d2
Copy link

FYI I was able to get this working. Once I reverted back to the older version (2.2.9), I ran in my project "npm upgrade" and it now seems to work.

@wingkwong
Copy link
Member

wingkwong commented May 6, 2024

Can you guys share how you upgraded it? also if possible please share your package.json / stackblitz link for us to investigate.

@DongwonGim
Copy link

I had the same issue and to fix it, I deleted all NextUI related lines in package.json first. And then, I type "npm install" and reinstalled library it using NextUI CLI by using "nextui add -all" and it fixed the dependency issue. Hope this helps.

@desmondinho
Copy link

desmondinho commented May 12, 2024

Hello,

I've just fixed the same issue while importing the DateRangePicker component.

The error is saying that calendar is not exported from the @nextui-org/theme, I checked the exports, and it really wasn't, so I updated the package to the latest.

After that I got another error that was saying something is not exported from @nextui-org/system, so I updated this package to the latest too.

Everything is working now like a charm!

P.S. One thing to note: when I ran nextui doctor, it didn't tell me there is something wrong with the deps. Maybe this thing could be considered as a potential improvement of the CLI in the future? @wingkwong

@wingkwong
Copy link
Member

P.S. One thing to note: when I ran nextui doctor, it didn't tell me there is something wrong with the deps. Maybe this thing could be considered as a potential improvement of the CLI in the future?

++@winchesHe

@wingkwong
Copy link
Member

Closing this issue - make sure you have latest @nextui-org/theme and @nextui-org/system. We'll follow up the dep upgrade on the CLI side.

@wingkwong wingkwong closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
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

5 participants