PlayForm / Compress

🗜️ Compress —
https://NPMJS.Org/@playform/compress
MIT License
470 stars 12 forks source link

Dynamic import will not move module into another chunk #320

Closed JuliusBairaktaris closed 4 months ago

JuliusBairaktaris commented 4 months ago

After upgrading Astro from version 2.2.15 to 2.2.20, I encountered an error when deploying my project to Cloudflare Pages. The error message indicates that there are conflicting imports of the logo.png file:

[plugin:vite:reporter] [plugin vite:reporter] 

logo.png is dynamically imported by /opt/buildhome/repo/src/utils/images.ts but also statically imported by /opt/buildhome/repo/src/components/Logo.astro dynamic import will not move module into another chunk.

This error is causing my Swiper carousels to break on the deployed site.

NikolaRHristov commented 4 months ago

Does it work without CompressAstro ?

JuliusBairaktaris commented 4 months ago

Yes and with compressastro 2.2.15.

NikolaRHristov commented 4 months ago

Can you try the latest astro-compress v2.2.21 and / or @playform/compress-astro v0.0.2 ? @JuliusBairaktaris

JuliusBairaktaris commented 4 months ago

The swiper slides work but the warning is still there. Tested with @playform/compress-astro v0.0.2

NikolaRHristov commented 4 months ago

I've cloned https://github.com/JuliusBairaktaris/astrowind locally and was able to build without astro-compress or @playform/compress-astro included and removed from astro.config.mjs and the vite warning still shows. The vite warning is just a warning, you can ignore it. It's not a problem with CompressAstro.

JuliusBairaktaris commented 4 months ago

Thanks for the great help!