cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.58k stars 664 forks source link

🐛 BUG: Fatal dev error in v3.62.0 and v3.73.0 #6611

Open ManasMadrecha opened 2 weeks ago

ManasMadrecha commented 2 weeks ago

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.61.0 [Wrangler], 4.5.10 [Hono]

What version of Node are you using?

20.8.10

What operating system and version are you using?

Windows 11

Describe the Bug

Observed behavior

When I update the wrangler to 3.62.0 and run wrangler dev src/index.ts --remote, I get the following error in the terminal which fails to start:

C:\Users\manas\dev\folder\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\folder\node_modules\miniflare\dist\src\index.js:9581:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (C:\Users\manas\dev\folder\node_modules\miniflare\dist\src\index.js:3599:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v20.16.0

This error only comes up when I upgrade the Wrangler version to v3.62.0 or more. On v3.61.0, everything is working fine.

Expected behavior

It should start normally as it always.

Steps to reproduce

I am using Hono for the CF worker.

Here is my package.json file

{
  "name": "XXXXX",
  "version": "1.5.0",
  "private": true,
  "scripts": {
    "dev": "wrangler dev src/index.ts",
    "dev-r": "wrangler dev src/index.ts --remote",
    "deploy": "wrangler deploy --minify src/index.ts"
  },
  "devDependencies": {
    "@cloudflare/workers-types": "^4.20240725.0",
    "@firebase/app-types": "^0.9.0",
    "@types/cookie": "^0.6.0",
    "@types/node": "^20.8.10",
    "@types/set-cookie-parser": "^2.4.7",
    "fast-xml-parser": "^4.3.2",
    "firebase-admin": "^12.0.0",
    "wrangler": "3.61.0",
    "yahoo-finance2": "^2.11.3"
  },
  "dependencies": {
    "@notionhq/client": "^2.2.15",
    "@nuxtjs/mdc": "^0.6.1",
    "@sagi.io/workers-jwt": "^0.0.23",
    "dayjs": "^1.11.12",
    "hono": "^4.5.10",
    "juice": "^11.0.0",
    "nanoid": "^5.0.3",
    "notion-to-md": "^3.1.1",
    "ofetch": "^1.3.4",
    "remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.0",
    "remark-mdc": "^3.2.0",
    "remark-parse": "^11.0.0",
    "remark-stringify": "^11.0.0",
    "scule": "^1.3.0",
    "set-cookie-parser": "^2.6.0",
    "slugify": "^1.6.6",
    "unified": "^11.0.5",
    "unist-util-remove-position": "^5.0.0",
    "web-auth-library": "^1.0.3",
    "zeptomail": "^6.0.0"
  }
}

And here is my wrangler.toml file:

name = "XXXXX"
main = "./src/index.ts"
workers_dev = true
compatibility_date = "2023-11-20"
route = { pattern = "XXXXX", custom_domain = true }
compatibility_flags = ['nodejs_compat']
keep_vars = true

kv_namespaces = [
  { binding = "KV", id = "XXXXX", preview_id = "XXXXX" },
  { binding = "KV_CACHE", id = "XXXXX", preview_id = "XXXXX" },
]

services = [
  { binding = "API", service = "XXXXX" }
]

rules = [{ type = "ESModule", globs = ["**/*.js", "**/*.mjs"] }]

[[d1_databases]]
binding = "DB" # i.e. available in your Worker on env.DB
database_name = "XXXXX"
database_id = "XXXXX"

# [[r2_buckets]]
# binding = "R2" # JS variable name
# bucket_name = "XXXXX"

[site]
bucket = "./public"

[dev]
port = 3000

Please provide a link to a minimal reproduction

.

Please provide any relevant error logs

No response

penalosa commented 2 days ago

Thanks for reporting this! Would you be able to provide a reproduction repo that demonstrates the issue?