QwikDev / astro

Qwik + Astro integration
216 stars 13 forks source link

I cannot build for Astro + Cloudflare + Qwik #62

Closed hckhanh closed 9 months ago

hckhanh commented 9 months ago

I received many error like this, and they broke my build

✘ [ERROR] Could not resolve "zlib"

    dist/$server_build/chunks/pages/_slug__JQIUuMKx.mjs:20:23:
      20 │ import require$$3 from 'zlib';
         ╵                        ~~~~~~

  The package "zlib" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
thejackshelton commented 9 months ago

So I actually had a similar problem here and cloudflare ssr, and the problem ended up being that the astro-icon integration in my project was not up-to-date with the fix for the svgo dependency.

I would go and find where zlib is being used around your repo or dependencies in the vscode search.

I would also try to narrow down the issue. Try creating a minimal reproduction of the astro qwik integration, and then using some of your dependencies until you run into the error. (or maybe before then)

Happy to deep dive if we can reproduce it with the integration alone 👍

thejackshelton commented 9 months ago

Closing due to inactivity, if you still come across this issue with a reproduction let me know and I can look into it.