withastro / adapters

Home for Astro's core maintained adapters
69 stars 41 forks source link

"npm run dev" is not working with Cloudflare/Astro adapter #332

Closed ghost closed 4 months ago

ghost commented 4 months ago

Astro Info

Astro                    v4.11.5
Node                     v20.15.1
System                   Windows (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/tailwind

Describe the Bug

I have recently created an astro/cloudflare project following the guidelines in the cloudflare pages frameworks guides and when I try to run the npm run dev command (which runs the astro dev command underneath) I get this error:

*** Received structured exception #0xc0000005: access violation; stack: 7ffabe7231f7 7ff6f14494eb 7ff6f14495b3 7ff6f143d1ec 7ff6f143d197 7ff6f0cb832e 7ff6f0cb863f 7ff6efba1706 7ff6efba14ea 7ff6f0e3047f 7ff6f0e37636 7ff6f0e3099c 7ff6f0e37636 7ff6f0e2e30c 7ff6efb91551 7ff6f24cc8df 7ffade2f257c 7ffadf2aaf27
The Workers runtime failed to start. There is likely additional logging output above.
  Stack trace:
    at #assembleAndUpdateConfig (C:\Users\Plustra\Projects\test-project\node_modules\miniflare\dist\src\index.js:9178:13)
    at async Mutex.runWith (C:\Users\Plustra\Projects\test-project\node_modules\miniflare\dist\src\index.js:3521:16)
    at async Miniflare2._getProxyClient (C:\Users\Plustra\Projects\test-project\node_modules\miniflare\dist\src\index.js:9359:5)
    at async getPlatformProxy (C:\Users\Plustra\Projects\test-project\node_modules\wrangler\wrangler-dist\cli.js:210786:20)
    at async withTakingALongTimeMsg (file:///C:/Users/Plustra/Projects/test-project/node_modules/astro/dist/integrations/hooks.js:23:18)

It does not happen with all commands, wrangler types command work, but other command that trigger a similar error would be wrangler d1 migrations apply ....

A curiosity about this problem is that I have created projects before using this same stack (astro/cloudflare) and it worked, no more than two months ago I didn't have this problem, I don't have those projects anymore, but I have only received this error in this most recent attempt to create a project.

What's the expected result?

Previously, in other projects similar to this one I have not had this problem and I have used exactly the same configurations and integrations, so the expected output is to be able to run a development server as in pasts proyects.

Link to Minimal Reproducible Example

unknown

Participation

alexanderniebuhr commented 4 months ago

Duplicate of https://github.com/withastro/adapters/issues/322

(It's an upstream issue in Cloudflare)

bot1131357 commented 4 months ago

Thanks. I want to add that the same issue happens when I run npm run dev with Nuxt. Project created based on this page.

PS C:\Cloudflare\nuxt-0> npm run dev

> dev
> nuxt dev

Nuxt 3.12.3 with Nitro 2.9.7                    11:10:26 am
                    11:10:27 am

              █▀▀▀▀▀▀▀█▀▀▀▀█▀██▀█▀▀▀▀▀▀▀█
              █ █▀▀▀█ ██▀█ ▄  ███ █▀▀▀█ █
              █ █   █ ███  ▀▄▄▄▄█ █   █ █
              █ ▀▀▀▀▀ █▀▄▀▄▀▄▀█▀█ ▀▀▀▀▀ █
              █▀▀█▀▀█▀█▄ ██ ▄█▀██▀█████▀█
              █ ▄▀▀▀▄▀ █▀▄█▀██ ▄ ▀▀  ▄▄▀█
              █ ██▀▄█▀▀▀▀▀█▀█▀▄▀ ▀█▄▄▄▄ █
              █ ▀ ▄▀ ▀ ▄▀▄█▄██ ▀▀█▄▄▀▀ ▀█
              █ █▄▀▄▀▀ ▄ ▄▄▀▀ █ ▀▀▀ █ ▀▄█
              █▀▀▀▀▀▀▀█▄▄█▀ █ ▄ █▀█ ▀█▄▀█
              █ █▀▀▀█ █▀▄▄█▄▄█▀ ▀▀▀ ▀████
              █ █   █ █▄██  █▀███▄▄▀▄▀  █
              █ ▀▀▀▀▀ █  ▀ ▄█▀ ▀▄ ▄▄▀▄▄ █
              ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  ➜ Local:    http://0.0.0.0:3000/
  ➜ Network:  http://192.168.1.134:3000/ [QR code]

  ➜ DevTools: press Shift + Alt + D in the browser (v1.3.9)                                                                                                                                                                                                                                                                   
                    11:10:30 am

 ╭─────────────────────────────────────────────────────────╮
 │                                                         │
 │  🔥 Cloudflare context bindings enabled for dev server  │
 │                                                         │
 │  Config path: wrangler.toml                             │
 │  Persist dir: .wrangler\state\v3                        │
 │                                                         │
 ╰─────────────────────────────────────────────────────────╯

ℹ Vite client warmed up in 2336ms                                                                                                                                                                                                                                                                                             
                   11:10:34 am
ℹ Vite server warmed up in 2450ms                                                                                                                                                                                                                                                                                             
                   11:10:35 am
✔ Nuxt Nitro server built in 1041 ms                                                                                                                                                                                                                                                                                          
             nitro 11:10:36 am

 ERROR  *** Received structured exception #0xc0000005: access violation; stack: 7ff846903027 7ff79afc94eb 7ff79afc95b3 7ff79afbd1ec 7ff79afbd197 7ff79a83832e 7ff79a83863f 7ff799721706 7ff7997214ea 7ff79a9b047f 7ff79a9b7636 7ff79a9b099c 7ff79a9b7636 7ff79a9ae30c 7ff799711551 7ff79c04c8df 7ff85485257c 7ff85604af27     

 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:1343: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:1425:3)
  at Miniflare2._getProxyClient (node_modules\miniflare\src\index.ts:1631:3)
  at Miniflare2.getBindings (node_modules\miniflare\src\index.ts:1654:23)
  at async getPlatformProxy (node_modules\wrangler\wrangler-dist\cli.js:210786:20)
  at _getPlatformProxy (node_modules\nitro-cloudflare-dev\dist\runtime\plugin.dev.mjs:41:17)

Hopefully it's fixed soon.

mohdlatif commented 3 months ago

same with me, I am using windows 11 23h2 for reference...

image