workers-sdk
workers-sdk copied to clipboard
๐ BUG: Fatal error on installing latest Nuxt with new Worker
Which Cloudflare product(s) does this pertain to?
Workers Runtime
What version(s) of the tool(s) are you using?
3.80.0 [Wrangler], 2.9.7 [Nitropack], 3.13.0 [Nuxt]
What version of Node are you using?
20.16.0
What operating system and version are you using?
Windows 11
Describe the Bug
Observed behavior
Error on starting a simple bare-bones app.
Expected behavior
It should start normally.
Steps to reproduce
Just follow the instruction on https://developers.cloudflare.com/workers/frameworks/framework-guides/nuxt
npm create cloudflare@latest my-nuxt-app -- --framework=nuxt --experimental- cd my-nuxt-app
npm run dev
This fails.
Note that npm run build succeeds. But then, npx wrangler dev fails.
Code
Here is the auto-generated wrangler.toml
#:schema node_modules/wrangler/config-schema.json
name = "my-nuxt-app"
compatibility_date = "2024-10-04"
main = "./dist/worker/index.js"
assets = { directory = "./dist/public", binding = "ASSETS" }
# Workers Logs
# Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
# Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
[observability]
enabled = true
Here is the auto-generated package-json
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "npm run build && wrangler dev",
"postinstall": "nuxt prepare",
"deploy": "npm run build && wrangler deploy",
"cf-typegen": "wrangler types"
},
"dependencies": {
"nuxt": "^3.13.0",
"vue": "latest",
"vue-router": "latest"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20241004.0",
"nitro-cloudflare-dev": "^0.1.6",
"nitropack": "^2.9.7",
"wrangler": "^3.80.2"
}
}
Please provide a link to a minimal reproduction
https://developers.cloudflare.com/workers/frameworks/framework-guides/nuxt
Please provide any relevant error logs
Error on npm run dev
Nuxt 3.13.2 with Nitro 2.9.7 3:47:16 pm
3:47:16 pm
โ Local: http://localhost:3000/
โ Network: use --host to expose
โ DevTools: press Shift + Alt + D in the browser (v1.5.2) 3:47:20 pm
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ ๐ฅ Cloudflare context bindings enabled for dev server โ
โ โ
โ Config path: wrangler.toml โ
โ Persist dir: .wrangler\state\v3 โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ Vite client built in 68ms 3:47:23 pm
โ Vite server built in 1177ms 3:47:24 pm
โ Nuxt Nitro server built in 1768 ms nitro 3:47:26 pm
โน Vite client warmed up in 1ms 3:47:26 pm
โน Vite server warmed up in 1339ms 3:47:28 pm
ERROR *** Received structured exception #0xc0000005: access violation; stack: 7ffd616e32f7 7ff75513587b 7ff755135943 7ff755128e3c 7ff755128de7 7ff754974e4e 7ff75497515f 7ff7537a1ee6 7ff754aefa9f 7ff754af6d36 7ff754aeffa3 7ff754af6d36 7ff754aed93c 7ff753791e61 7ff7562377ef 7ffdb20f257c 7ffdb356af07
ERROR Failed to initialize wrangler bindings proxy The Workers runtime failed to start. There is likely additional logging output above.
at Miniflare2.#assembleAndUpdateConfig (node_modules\miniflare\src\index.ts:1395:10)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at Mutex.runWith (node_modules\miniflare\src\workers\shared\sync.ts:66:45)
at Miniflare2.#waitForReady (node_modules\miniflare\src\index.ts:1477:3)
at Miniflare2._getProxyClient (node_modules\miniflare\src\index.ts:1683:3)
at Miniflare2.getBindings (node_modules\miniflare\src\index.ts:1706:23)
at async getPlatformProxy (node_modules\wrangler\wrangler-dist\cli.js:217201:20)
at _getPlatformProxy (node_modules\nitro-cloudflare-dev\dist\runtime\plugin.dev.mjs:41:17)
Error on npx wrangler dev after successfully running npm run build
npx wrangler dev
โ
๏ธ wrangler 3.80.2
-------------------
โฒ [WARNING] The entrypoint dist\worker\index.js has exports like an ES Module, but hasn't defined a default export like a module worker normally would. Building the worker using "service-worker" format...
X [ERROR] There was an access violation in the runtime.
On Windows, this may be caused by an outdated Microsoft Visual C++ Redistributable library.
Check that you have the latest version installed.
See https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist.
โ Starting local server...
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ [b] open a browser, [d] open devtools, [l] turn off local mode, [c] clear console, [x] to exit โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
C:\Users\manas\dev\PROJECT\cf-w-nuxt\node_modules\wrangler\wrangler-dist\cli.js:29768
throw a;
^
MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
at #assembleAndUpdateConfig (C:\Users\manas\dev\manasmoney\cf-w-nuxt\node_modules\miniflare\dist\src\index.js:9842:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Mutex.runWith (C:\Users\manas\dev\manasmoney\cf-w-nuxt\node_modules\miniflare\dist\src\index.js:3627:16) {
code: 'ERR_RUNTIME_FAILURE',
cause: undefined
}
Node.js v20.16.0
Hmm don't think this is specific to Nuxt but this is a workerd exception on Windows.
See the error message shown when you hit the error:
On Windows, this may be caused by an outdated Microsoft Visual C++ Redistributable library.
Check that you have the latest version installed.
See https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist.
Have you tried this?
The Windows error might prop up on npx wrangler dev, but why is the first command of npm run dev itself showing an error that workerd unable to initialise worker bindings or so? ๐ฏ
I've a Nuxt 3 app running on CF Pages nicely. But I wanted to try the new option available on running the framework on workers as well.
@ManasMadrecha to clarify, have you tried updating the Microsoft Visual C++ Redistributable library? What version are you on?
Yes, updated that and now it's working. ๐ฏ Seemed like a pretty easy solution, but don't know why it was an issue in the first place ๐๐ป