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
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
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