cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
5.91k stars 267 forks source link

🐛 Bug Report — Runtime APIs #2363

Open Xeffen25 opened 2 weeks ago

Xeffen25 commented 2 weeks ago

Astro Info

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

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I initialize an astro project with: npm create astro@latest

And add the Cloudflare adapter: npx astro add cloudflare

Finaly run: npm run dev

Results in the following error: *** Received structured exception #0xc0000005: access violation; stack: 7ff89774301f 7ff62208337b 7ff622083443 7ff6220774bc 7ff622077467 7ff6218f7d5e 7ff6218f806f 7ff6207e1706 7ff6207e14ea 7ff621a6f97f 7ff621a76b36 7ff621a6fe9c 7ff621a76b36 7ff621a6d80c 7ff6207d1551 7ff623158bff 7ff8afb7257c 7ff8b07caf27 The Workers runtime failed to start. There is likely additional logging output above. Stack trace: at #assembleAndUpdateConfig (C:\it\test\node_modules\miniflare\dist\src\index.js:9178:13) at async Mutex.runWith (C:\it\test\node_modules\miniflare\dist\src\index.js:3521:16) at async Miniflare2._getProxyClient (C:\it\test\node_modules\miniflare\dist\src\index.js:9359:5) at async getPlatformProxy (C:\it\test\node_modules\wrangler\wrangler-dist\cli.js:210460:20) at async withTakingALongTimeMsg (file:///C:/it/test/node_modules/astro/dist/integrations/hooks.js:23:18)

I was using a node version manager Volta. Tried uninsalling and installing node manualy. Tried also using pnpm. Not found any Issue reported so created one. I think it has to do with the Workerd Runtime for development but I am unsure. As when deploying the project on Cloudflare it works. You can also not run the npm run preview it also gives an error.

I attempted to create a reproductible example but when starting from basic template in StackBlitz and just adding the Cloudflare Adapter it doesn't work but gives the following error instead: ❯ npm run dev

@example/basics@0.0.1 dev astro dev

04:01:54 [WARN] The currently selected adapter @astrojs/cloudflare is not compatible with the image service "Sharp". 04:01:54 [WARN] [config] The feature "astro:env getSecret" is experimental and subject to change (used by @astrojs/cloudflare). 04:01:54 [types] Added src/env.d.ts type declarations. 04:02:01 [build] Waiting for integration "@astrojs/cloudflare", hook "astro:server:setup"... /home/projects/qgnirbojgz.github/node_modules/@cloudflare/workerd-linux-64/bin/workerd: line 17: "foo(" must be followed by )

What's the expected result?

The expected output is to be able to run a development server.

Link to Minimal Reproducible Example

unknown

Participation

fhanau commented 2 weeks ago

This looks like a Windows-specific issue we're investigating in the workers-sdk repo (https://github.com/cloudflare/workers-sdk/issues/6170). Can you see if this works for you with workerd version 1.20240614.0? On that issue the structured exception error starts appearing with the version after that.