nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
984 stars 56 forks source link

Local Development Server works fine but deploying to NuxtHub results in a `500` Error on all pages #205

Closed maclong9 closed 3 months ago

maclong9 commented 3 months ago

Describe the bug Locally there are no errors whatsoever across the whole application, even when running tsc and eslint however after deploying to NuxtHub none of the pages load the whole app just returns a 500 error with the following message in the server logs:

GET 500 /
[nuxt] [request error] [unhandled] [500],Cannot access 'default' before initialization
  at chunks/routes/renderer.mjs:1:119508  
  at async chunks/routes/renderer.mjs:1:119461  
  at async chunks/routes/renderer.mjs:1:121547  
  at async Object.handler (chunks/routes/renderer.mjs:1:120585)  
  at async Object.handler (chunks/runtime.mjs:1:74748)  
  at async chunks/runtime.mjs:1:77686  
  at async chunks/runtime.mjs:1:114971
[nuxt] [request error] [unhandled] [500],Cannot access 'default' before initialization
  at chunks/routes/renderer.mjs:1:119508  
  at async chunks/routes/renderer.mjs:1:119461  
  at async chunks/routes/renderer.mjs:1:121547  
  at async Object.handler (chunks/routes/renderer.mjs:1:120585)  
  at async Object.handler (chunks/runtime.mjs:1:74748)  
  at async chunks/runtime.mjs:1:77686  
  at async chunks/runtime.mjs:1:114971  
  at async errorHandler (chunks/runtime.mjs:1:108660)  
  at async chunks/runtime.mjs:1:77840  
  at async chunks/runtime.mjs:1:114971

I've done a search for cannot access 'default' before initialised but have been unable to find anything.

Steps to reproduce Steps to reproduce the behavior:

  1. Create Nuxt App
  2. Deploy to Hub
  3. Open Server logs and then site
  4. See error

Expected behavior The site and pages should load as they do on the localhost

maclong9 commented 3 months ago

Nevermind I found a different issue with the same thing, seems to be an issue with pnpm I've switched over to npm.