Comments (10)
I am trying to find the piece of code that is causing this.
If not, I'll send the repo of my project.
I'm not at home right now, but I'll do it right after!
from core.
I am also having same problem for my fresh new application deployed without any additional dependencies, at some point it was working though. Everything works locally but not on cloudflare.
23:07:03.399
Connected to production deployment logs...
23:07:05.391
GET 500 /
[nuxt] [request error] [unhandled] [500],global is not defined
at chunks/build/server.mjs:1:157309
[nuxt] [request error] [unhandled] [500],Cannot access 'default' before initialization
at chunks/routes/renderer.mjs:1:113671
at async chunks/routes/renderer.mjs:1:113624
at async zn (chunks/routes/renderer.mjs:1:115291)
at async Object.handler (chunks/routes/renderer.mjs:1:117789)
at async Object.handler (chunks/runtime.mjs:1:74628)
at async chunks/runtime.mjs:1:77560
at async chunks/runtime.mjs:1:111660
at async errorHandler (chunks/runtime.mjs:1:106396)
at async chunks/runtime.mjs:1:77712
at async chunks/runtime.mjs:1:111660
from core.
Could you try by adding shamefully-hoist=true
into .npmrc
file in project root and clean install?
Most likely, this happens because of PNPM which cause generation to miss some packages.
from core.
Hey 👋,
Could you provide a reproduction? Or the piece of code that generate this?
from core.
I have not yet found the piece of code that is causing the error.
I will continue to test and see if I can find it. In the meantime, I will send my project anyway, as you may know more quickly what the problem is.
Repo: https://github.com/ArisCorporation/Website
from core.
Okay, i have an update.
The error:
[nuxt] [request error] [unhandled] [500],Cannot access 'default' before initialization
at chunks/routes/renderer.mjs:1:25256
at async chunks/routes/renderer.mjs:1:25209
at async ye (chunks/routes/renderer.mjs:1:26859)
at async Object.handler (chunks/routes/renderer.mjs:1:29357)
at async Object.handler (chunks/runtime.mjs:1:77446)
at async chunks/runtime.mjs:1:80378
at async chunks/runtime.mjs:1:130717
Is from dayjs-nuxt module.
Now i removed the dayjs module and get now this error:
[nuxt] [request error] [unhandled] [500],Cannot access 'bS' before initialization
at chunks/routes/renderer.mjs:1:25282
at async chunks/routes/renderer.mjs:1:25219
at async chunks/routes/renderer.mjs:1:27415
at async Object.handler (chunks/routes/renderer.mjs:1:26359)
at async Object.handler (chunks/runtime.mjs:1:75815)
at async chunks/runtime.mjs:1:78952
at async chunks/runtime.mjs:1:128292
[nuxt] [request error] [unhandled] [500],Cannot access 'bS' before initialization
at chunks/routes/renderer.mjs:1:25282
at async chunks/routes/renderer.mjs:1:25219
at async chunks/routes/renderer.mjs:1:27415
at async Object.handler (chunks/routes/renderer.mjs:1:26359)
at async Object.handler (chunks/runtime.mjs:1:75815)
at async chunks/runtime.mjs:1:78952
at async chunks/runtime.mjs:1:128292
at async errorHandler (chunks/runtime.mjs:1:116654)
at async chunks/runtime.mjs:1:79104
at async chunks/runtime.mjs:1:128292
I haven't found the source of the error yet, but I'm doing my best
from core.
I have another update!
I found 2 problems.
- The pinia nuxt module is one problem.
- And when i have the pnpm lockfile in the repo it brings these weird "cannot access x before intialization". When i delete the lockfile it works fine.
from core.
+1 this appears to be an issue with pnpm.
I have a project with zero additional deps, using npm the build works fine, using pnpm it errors with the same message as OP.
Node version: v21.7.3
pnpm version: 8.6.12
npm version: 10.5.0
{
"name": "nuxt-app",
"type": "module",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@nuxthub/core": "^0.7.0",
"nuxt": "^3.12.2",
"vue": "latest"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.2",
"eslint": "9.5.0"
}
}
from core.
Alright, unfortunately i cannot use NuxtHub for my project, because it is not possible to use the @directus/sdk with CloudFlare Pages. It doesn't support the credential property and i get this error:
The 'credentials' field on 'RequestInitializerDict' is not implemented
But this isn't a NuxtHub related issue.
from core.
Closing, feel free to re-open if the error persists after following farnabaz comment.
from core.
Related Issues (20)
- 403 error with D1 but R2 authenticates when using remote storage
- [Admin Console] No info/error when repo is not available HOT 1
- adding the NuxtHub module give me error with throw createError HOT 2
- [Admin Console] Can't find organization repositories HOT 1
- useNitroApp() don't access values from plugin in prod HOT 2
- Nuxt 4 support should be turned off by default HOT 1
- Local Development Server works fine but deploying to NuxtHub results in a `500` Error on all pages HOT 1
- [Admin] Hide delete team button when not possible HOT 1
- Support Cloudflare Hyperdrive connection in Nuxt-hub HOT 1
- Command to copy production database into preview HOT 1
- [ADMIN| Better error message when call to database fails HOT 1
- [Feature]: Allow linking the same repository to multiple projects HOT 2
- [Admin Console] "Too many API requests by single worker invocation." when opening large cache HOT 2
- [nuxt] [request error] [unhandled] [500] global is not defined HOT 5
- Dependency Dashboard
- [Admin Console] Can't delete database entries without id HOT 3
- [Admin Console] DB Table Header is hard to read when scrolling
- Im getting error "Error when creating the project Cannot read properties of null (reading 'find')". HOT 1
- Cloudflare - Durable Object support HOT 1
- Missing DB Binding (D1) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.