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

Issue - Calendar component app crash on vercel #3560

Closed
KundwaBruno opened this issue Jul 25, 2024 · 15 comments
Closed

Issue - Calendar component app crash on vercel #3560

KundwaBruno opened this issue Jul 25, 2024 · 15 comments

Comments

@KundwaBruno
Copy link

NextUI Version

2.4.6

Describe the bug

I recently upgraded to nextui version 2.4.6 in order for me to use the perfect DatePicker and Calendar components. Howver once i run the app locally, it runs fine without any BUGS, but on vercel the app crashes and in the logs it displays the error below.

Tried using vercel's node version and the build was still running fine without errors.

Error: Cannot find package '/var/task/node_modules/@react-aria/calendar/node_modules/@react-stately/utils/package.json' imported from /var/task/node_modules/@react-aria/calendar/node_modules/@react-aria/utils/dist/import.mjs
Did you mean to import "@react-stately/utils/dist/main.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:219:26)
    at packageResolve (node:internal/modules/esm/resolve:845:14)
    at moduleResolve (node:internal/modules/esm/resolve:931:18)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:1173:14)
    at defaultResolve (node:internal/modules/esm/resolve:1216:79)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND',
  page: '/'
}

Local node version: 22.2.0
Vercel node version: 20.x

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

The Issue comes on vercel only

Expected behavior

Should run without the app crashing

Screenshots or Videos

No response

Operating System Version

MacOs

Browser

Chrome

Copy link

linear bot commented Jul 25, 2024

@KundwaBruno KundwaBruno changed the title [BUG] - Calendar component app crash on vercel [Issue] - Calendar component app crash on vercel Jul 25, 2024
@KundwaBruno KundwaBruno changed the title [Issue] - Calendar component app crash on vercel Issue - Calendar component app crash on vercel Jul 25, 2024
@awesome-pro
Copy link
Contributor

awesome-pro commented Jul 26, 2024

Seems like this issue on NextJs

kindly follow these steps -

  1. Try to resolve all warnings
  2. Run npm run lint on the local environment, and check for errors
  3. Set env variable CI = false and run npm ci --include=dev, CI = true considers warnings as errors

See if the error stills persists.
@KundwaBruno Kindly follow the above steps and confirm again

@KundwaBruno
Copy link
Author

KundwaBruno commented Jul 26, 2024

@abhinandan-verma Thanks for the quick response,

FYI the build is passing fine both locally and remotely, only the app crashes remotely with the error above and locally the app runs perfect.

  1. I have cleared all errors and warnings, currentlynpm run lint shows no errors or warnings
  2. Which environment should i run npm ci --include=dev because locally the app runs fine until i push it to vercel.

@awesome-pro
Copy link
Contributor

@KundwaBruno you should run it remotely, observe the changes (if any).
Confirm if you still have the issue.

@KundwaBruno
Copy link
Author

Okay, kindly guide me where to add this @abhinandan-verma

@awesome-pro
Copy link
Contributor

@KundwaBruno for your help, I deployed a test app with Calendar component on Vercel, and deployment was successful. Maybe you are having some configuration or dependency conflict issue.
here is app and repo link
repo
app

I will recommend, compare the configurations with your own app with mine one , update your dependencies. Hopefully you should get your issue resolved.

@awesome-pro
Copy link
Contributor

@KundwaBruno are you still facing the same issue?
did you compare the configuration and dependencies?

Kindly confirm

@KundwaBruno
Copy link
Author

Now i just got another one after i updated my dependency version to the ones in your repo.

⨯ Error: Cannot find package '/var/task/node_modules/@nextui-org/slider/node_modules/@react-aria/ssr/package.json' imported from /var/task/node_modules/@nextui-org/slider/node_modules/@react-aria/i18n/dist/useDefaultLocale.mjs
Did you mean to import "@react-aria/ssr/dist/main.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:219:26)
    at packageResolve (node:internal/modules/esm/resolve:845:14)
    at moduleResolve (node:internal/modules/esm/resolve:931:18)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:1173:14)
    at defaultResolve (node:internal/modules/esm/resolve:1216:79)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND',
  page: '/'
}

I'm use the pages router tho

@abhinandan-verma

@KundwaBruno
Copy link
Author

@abhinandan-verma You still there?

@wingkwong
Copy link
Member

@KundwaBruno please share a minimal reproducible environment.

@KundwaBruno
Copy link
Author

KundwaBruno commented Aug 8, 2024

@wingkwong I reverted back to version 2.4.10 of nextui/react and it worked, not sure if it's issue within next-ui itself

@wingkwong
Copy link
Member

Closing - not able to reproduce.

@wingkwong wingkwong closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2024
@hmbrg
Copy link

hmbrg commented Sep 9, 2024

I'm having the exact same issue, also just on Vercel and while using Pages router.

@notrealradical
Copy link

Having the same issue with Vercel and Remix

@syskin
Copy link

syskin commented Oct 6, 2024

I faced the same issue with the following stack :

  • Nextjs 14.2.14
  • @nextui-org/react 2.4.8

Local and remote build works correctly, no any warn or errors.
I'm using the page router.

I don't use the Calendar component in my project.

It causes my app crashes on Vercel :

⨯ Error: Cannot find package '/var/task/node_modules/@nextui-org/calendar/node_modules/@react-aria/i18n/node_modules/@react-stately/utils/index.js' imported from /var/task/node_modules/@nextui-org/calendar/node_modules/@react-aria/i18n/node_modules/@react-aria/utils/dist/import.mjs Did you mean to import "@react-stately/utils/dist/main.js"? at legacyMainResolve (node:internal/modules/esm/resolve:219:26) at packageResolve (node:internal/modules/esm/resolve:845:14) at moduleResolve (node:internal/modules/esm/resolve:931:18) at moduleResolveWithNodePath (node:internal/modules/esm/resolve:1173:14) at defaultResolve (node:internal/modules/esm/resolve:1216:79) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40) at link (node:internal/modules/esm/module_job:95:36) { code: 'ERR_MODULE_NOT_FOUND', page: '/features' }
Oct 06 09:42:47.73
GET
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.

I have the same behaviour for date-picker component :

⨯ Error: Cannot find package '/var/task/node_modules/@nextui-org/date-picker/node_modules/@react-aria/i18n/node_modules/@react-stately/utils/index.js' imported from /var/task/node_modules/@nextui-org/date-picker/node_modules/@react-aria/i18n/node_modules/@react-aria/utils/dist/import.mjs

I downgraded @nextui-org/react to 2.3.6, and everything works as expected.

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

6 participants