natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
996 stars 57 forks source link

Build errors on Vercel #93

Closed JayBox325 closed 1 year ago

JayBox325 commented 1 year ago

Please see this error. It happens for all icons, but the build process works perfectly on my local environment:

error   [astro-icon] Unable to load icon "basil:linkedin-solid"!
--
19:44:36.540 | Error: Unknown builtin plugin "cleanupIDs" specified.
19:44:36.541 | Error: [astro-icon] Unable to load icon "basil:linkedin-solid"!
19:44:36.541 | Error: Unknown builtin plugin "cleanupIDs" specified.
19:44:36.541 | at file:///vercel/path0/astro/dist/chunks/pages/all.831608ca.mjs:2323:13
19:44:36.541 | at async AstroComponentInstance.render (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1586:7)
19:44:36.541 | at async renderChild (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1643:5)
19:44:36.542 | at async [Symbol.asyncIterator] (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1310:7)
19:44:36.542 | at async renderAstroTemplateResult (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1318:20)
19:44:36.542 | at async renderChild (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1641:5)
19:44:36.542 | at async [Symbol.asyncIterator] (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1310:7)
19:44:36.542 | at async renderChild (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1641:5)
19:44:36.542 | at async renderChild (file:///vercel/path0/astro/dist/chunks/astro.4d0feab3.mjs:1647:5)
19:44:36.585 | Error: Command "npm run build" exited with 1
tdmichaelis commented 1 year ago

I have this same problem while I am inside a vercel turborepo... I can create a standalone project and it works just fine but when I add that project to a vercel turborepo I get those errors. So maybe it is not specifically an astro-icon problem. I am still digging into the issue.

JayBox325 commented 1 year ago

I have tried this today with a local SVG and it's the same Unknown builtin plugin "cleanupIDs" specified. error.

jud3v2 commented 1 year ago

same error on cloudflare

JayBox325 commented 1 year ago

I have found a workaround for now, that involves adding "svgo": "2.8.0" to your devDependencies.

ashishlotake commented 1 year ago

Thanks @JayBox325 adding "svgo": "2.8.0" to devDependencies works.

stramel commented 1 year ago

This looks like it is due to svgo version conflict. This should be addressed as part of the v1 rework.

YannisHaismann commented 1 year ago

Svgo 3.0.+ need to be downgrade to 2.8.0 and set in devDependencies in package.json :

  1. npm install --save-dev svgo@2.8.0
  2. Delete package-lock.json & node_modules
  3. npm i
  4. npm run build
stramel commented 1 year ago

This a duplicate of #76