miniflare
miniflare copied to clipboard
TypeError: Cannot read properties of undefined (reading 'split')
My code work in a worker in cloudflare worker but not in loacl
The Error :
TypeError: Cannot read properties of undefined (reading 'split') at handleRequest (/home/valentin/test.js:2925:45) at /home/valentin/test.js:3065:27 at /usr/local/lib/node_modules/miniflare/node_modules/@miniflare/shared/src/event.ts:29:9 at EventTarget.<anonymous> (/usr/local/lib/node_modules/miniflare/node_modules/@miniflare/shared/src/event.ts:77:9) at EventTarget.[nodejs.internal.kHybridDispatch] (node:internal/event_target:643:20) at EventTarget.dispatchEvent (node:internal/event_target:585:26) at EventTarget.dispatchEvent (/usr/local/lib/node_modules/miniflare/node_modules/@miniflare/shared/src/event.ts:63:18) at EventTarget.dispatchEvent (/usr/local/lib/node_modules/miniflare/node_modules/@miniflare/shared/src/event.ts:87:26) at EventTarget.[kDispatchFetch] (/usr/local/lib/node_modules/miniflare/node_modules/@miniflare/core/src/standards/event.ts:356:13) at EventTarget.[kDispatchFetch] (/usr/local/lib/node_modules/miniflare/node_modules/@miniflare/core/src/index.ts:1067:31) GET / 500 Internal Server Error (66.07ms)
NodeJS 16
Ubuntu 20.04
Hey! 👋 Are you able to share your code or a minimal reproduction? It looks like this error is happening in your handleRequest
function.
Facing same issue with nuxt 3
I found out that process.versions.node
is undefined and there are a lot of packages in my dependencies that rely on that it's a string.
For example:
const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10));
Related: https://github.com/nuxt-modules/i18n/issues/1993
This can happen when deploying Nuxt with an incompatible unstorage driver.
Facing same issue with nuxt 3
Can you use kv in nuxt now?