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

Failed with nuxt layers and cloudflare deploy #1149

Closed
xusimr97 opened this issue Oct 24, 2024 · 2 comments
Closed

Failed with nuxt layers and cloudflare deploy #1149

xusimr97 opened this issue Oct 24, 2024 · 2 comments

Comments

@xusimr97
Copy link

xusimr97 commented Oct 24, 2024

If i create a new nuxt layer, and install this module. when i deploy it to cloud flare i get a 500.

steps to reproduce:
-npx nuxi init --template layer test-layer

  • cd test-layer
  • npm install nuxt-booster
  • npm run build
  • npx wrangler pages deploy .playground/dist/

this is my simple nuxt.config.ts:
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
'nuxt-booster'
],
nitro: {
"preset": "cloudflare_pages",
}
})

This is the error i get:
"logs": [
{
"message": [
"[nuxt] [request error] [unhandled] [500]",
"Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler. https://developers.cloudflare.com/workers/runtime-apis/handlers/\n at NodeCache._checkData (chunks/build/entry-CmUIuQz0.mjs:1:13649) \n at new NodeCache (chunks/build/entry-CmUIuQz0.mjs:1:10529) \n at chunks/build/entry-CmUIuQz0.mjs:1:36371"
],
"level": "error",
"timestamp": 1729796801922
},
{
"message": [
"[nuxt] [request error] [unhandled] [500]",
"Cannot access 'e' before initialization\n at chunks/build/server.mjs:1:3572 \n at async entry (chunks/build/server.mjs:1:3508) \n at async Object.renderToString (chunks/routes/renderer.mjs:1:3863) \n at async chunks/routes/renderer.mjs:1:113319 \n at async Object.handler (chunks/routes/renderer.mjs:1:112193) \n at async Object.handler (chunks/runtime.mjs:1:74005) \n at async chunks/runtime.mjs:1:77142 \n at async chunks/runtime.mjs:1:109480 \n at async errorHandler (chunks/runtime.mjs:1:105423) \n at async chunks/runtime.mjs:1:77294"
],
"level": "error",
"timestamp": 1729796801922
}
],

This only happens with this module, if i dissable it it works well

@ThornWalli
Copy link
Contributor

Hello @xusimr97,

You can test the next release.
I have removed node-cache there.

@ThornWalli
Copy link
Contributor

I'm closing the issue, if there is anything else you can open it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants