astro-embed
astro-embed copied to clipboard
Build not working with SSR adapter
Hi! Maybe this is a known issue, I haven't found anything among the solved issues.
The build does not work with an SSR adapter, I'm using Cloudlfare and I get this error:
[ERROR] [vite] x Build failed in 2.44s
[commonjs--resolver] [plugin vite:resolve] Cannot bundle Node.js built-in "perf_hooks" imported from "node_modules/linkedom/commonjs/perf_hooks.cjs". Consider disabling ssr.noExternal or remove the built-in dependency.
Any suggestions?
I appreciate your help
Thanks for reporting @arlee17!
Looks like linkedom
, which we use to parse HTML depends on some Node internals not available on Cloudflare. We probably need to look if there's a quick fix or if we need an alternative HTML parser that doesn't rely on Node APIs.
@delucis I am also getting same issues. It would be good if this issue could be fixed
Hi @IshanKBG, I don’t have much time to work on this library very often unfortunately, but would certainly look at a PR if anyone has time to work on it!
@delucis well i got it working by importing from linkedom/worker
which seems to work in all js runtimes.
Here is the more info
I have also opened a pr so it.