workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

๐Ÿ› BUG: wrangler pages dev runtime failure

Open Sammy-T opened this issue 1 year ago โ€ข 3 comments

Which Cloudflare product(s) does this pertain to?

Wrangler core

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

Wrangler v3.62.0

What version of Node are you using?

18.19.1

What operating system and version are you using?

Windows 10

Describe the Bug

Observed behavior

wrangler pages dev [directory] fails on v3.62.0. The exact same command is successful using v3.61.0 though.

Expected behavior

Successfully run the local server.

Steps to reproduce

  • Initialize node project directory.
  • Create test page in subdirectory. ex. site/index.html
  • Create package.json script. "dev": "wrangler pages dev site"
  • Install wrangler. ex. pnpm i -D wrangler or npm i -D wrangler
  • Run package.json script. pnpm run dev or npm run dev (neither worked for me.)

Please provide a link to a minimal reproduction

https://github.com/Sammy-T/wrangler-pages-err

Please provide any relevant error logs

 โ›…๏ธ wrangler 3.62.0
-------------------

โ–ฒ [WARNING] No compatibility_date was specified. Using today's date: 2024-06-29.

  โฏโฏ Add one to your wrangler.toml file: compatibility_date = "2024-06-29", or
  โฏโฏ Pass it in your terminal: wrangler pages dev [<DIRECTORY>] --compatibility-date=2024-06-29

  See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more information.


No functions. Shimming...
โŽ” Starting local server...

C:\Users\Sammy\Desktop\New folder\node_modules\.pnpm\[email protected]\node_modules\wrangler\wrangler-dist\cli.js:29747
            throw a;
            ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (C:\Users\Sammy\Desktop\New folder\node_modules\.pnpm\[email protected]\node_modules\miniflare\dist\src\index.js:9161:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (C:\Users\Sammy\Desktop\New folder\node_modules\.pnpm\[email protected]\node_modules\miniflare\dist\src\index.js:3521:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v18.19.1
โ€‰ELIFECYCLEโ€‰ Command failed with exit code 7.

Sammy-T avatar Jun 29 '24 07:06 Sammy-T

I just tried to reproduce this on MacOS and Windows and it worked both times. For example on Windows:

PS C:\Users\Admin\dev\temp\foo> pnpm run dev

> [email protected] dev C:\Users\Admin\dev\temp\foo
> wrangler pages dev site


 โ›…๏ธ wrangler 3.62.0
-------------------

โ–ฒ [WARNING] No compatibility_date was specified. Using today's date: 2024-06-29.

  โฏโฏ Add one to your wrangler.toml file: compatibility_date = "2024-06-29", or
  โฏโฏ Pass it in your terminal: wrangler pages dev [<DIRECTORY>] --compatibility-date=2024-06-29    
  
  See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more information.


No functions. Shimming...
โŽ” Starting local server...
[wrangler:inf] Ready on http://127.0.0.1:8788
[wrangler:inf] GET / 200 OK (19ms)
[wrangler:inf] GET /favicon.ico 200 OK (19ms)

Edition Windows 10 Pro Version 22H2 Installed on โ€Ž01/โ€Ž04/โ€Ž2021 OS build 19045.4529 Experience Windows Feature Experience Pack 1000.19058.1000.0

petebacondarwin avatar Jun 29 '24 13:06 petebacondarwin

Could you create a reproduction and push it to a github repository so that we can try it out?

petebacondarwin avatar Jun 29 '24 13:06 petebacondarwin

Sure, I updated the description with a link to it.

Sammy-T avatar Jun 29 '24 18:06 Sammy-T

@Sammy-T I'm unable to reproduce this with your reproduction repo. Could you try upgrading to the latest version of Node & Wrangler? What's the specific version number of your Windows 10 install?

penalosa avatar Jul 08 '24 11:07 penalosa

I updated both wrangler and node and it still fails. Here's my OS info and the received error.

Windows 10 22H2 Version 10.0.19045 Build 19045

โ›…๏ธ wrangler 3.63.1
-------------------

โ–ฒ [WARNING] No compatibility_date was specified. Using today's date: 2024-07-08.

  โฏโฏ Add one to your wrangler.toml file: compatibility_date = "2024-07-08", or
  โฏโฏ Pass it in your terminal: wrangler pages dev [<DIRECTORY>] --compatibility-date=2024-07-08

  See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more information.


No Functions. Shimming...
โŽ” Starting local server...
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit                                               โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
C:\Users\Sammy\Documents\GitHub\temp\wrangler-pages-err\node_modules\wrangler\wrangler-dist\cli.js:29765
            throw a;
            ^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (C:\Users\Sammy\Documents\GitHub\temp\wrangler-pages-err\node_modules\miniflare\dist\src\index.js:9178:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (C:\Users\Sammy\Documents\GitHub\temp\wrangler-pages-err\node_modules\miniflare\dist\src\index.js:3521:16) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

Node.js v20.15.1

Sammy-T avatar Jul 08 '24 23:07 Sammy-T

Same for me [email protected] works but anything later breaks with the same error (windows 10 22h2) EDIT: Solved it thanks to https://github.com/cloudflare/workers-sdk/issues/6170#issuecomment-2245209918

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 Update latest Visual C++ Redistributable and it works with [email protected]

cpakken avatar Jul 24 '24 21:07 cpakken

Same for me [email protected] works but anything later breaks with the same error (windows 10 22h2) EDIT: Solved it thanks to #6170 (comment)

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 Update latest Visual C++ Redistributable and it works with [email protected]

That seems to have fixed it for me. Thanks, @cpakken.

Sammy-T avatar Jul 25 '24 02:07 Sammy-T