Closed ambrt closed 1 month ago
When running astro dev
it uses the Vite dev server, which uses Node. This means Cloudflare-only code can be hard to run. In this case it's because Vite can't resolve wasm without an extra plugin, or with an '?init
param on the import. I downloaded your repo and it works fine as-is if I run npm run build
and then npx wrangler pages dev ./dist
. To get it working in dev you can change the import to import * as photon from '@cf-wasm/photon/node';
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
In both minimal installation (on stackblitz) and on my PC (with
@astrojs/cloudflare
), addingnpm install @cf-wasm/photon
and importing it in endpoint throws error:Error is same when using Cloudflare adapter and minimal Astro repo.
What's the expected result?
Astro should load ".wasm" from
@cf-wasm/photon
(with/without Cloudflare adapter)Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-s3fqit?file=src%2Fpages%2Fphoton.ts,package.json&on=stackblitz
Participation