natemoo-re / astro-icon

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

Cloudflare ETIMEOUT #152

Closed kulak91 closed 7 months ago

kulak91 commented 7 months ago

Hello, guys! I have been using astro + astro icon deployed on cloudflare pages for a year already and it was working fine untill the last few months. Currently 20% of deployments receiving an error related to the astro-icon:

12:49:47.315      FetchError: request to https://api.astroicon.dev/v1/mdi/language-javascript failed, reason: read ETIMEDOUT
12:49:47.315      File:
12:49:47.315        file
12:49:47.316      Stacktrace:
12:49:47.316    Error: [astro-icon] Unable to load icon "mdi:language-javascript"!
12:49:47.316    FetchError: request to https://api.astroicon.dev/v1/mdi/language-javascript failed, reason: read ETIMEDOUT
12:49:47.316        at file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:2039:15
12:49:47.317        at runMicrotasks (<anonymous>)
12:49:47.317        at processTicksAndRejections (node:internal/process/task_queues:96:5)
12:49:47.317        at async Promise.all (index 0)
12:49:47.317        at async file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:2036:17
12:49:47.317        at async renderToIterable (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:688:21)
12:49:47.317        at async renderAstroComponentInline (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:1216:24)
12:49:47.318        at async renderChild (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:724:5)
12:49:47.318        at async AstroComponent.[Symbol.asyncIterator] (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:646:7)
12:49:47.318        at async renderAstroComponent (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:657:20)
12:49:47.318        at async renderAstroComponentInline (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:1217:9)
12:49:47.318        at async renderChild (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:724:5)
12:49:47.319        at async AstroComponent.[Symbol.asyncIterator] (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:646:7)
12:49:47.319        at async renderAstroComponent (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:657:20)
12:49:47.319        at async renderAstroComponentInline (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:1217:9)
12:49:47.319        at async renderChild (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:724:5)
12:49:47.320        at async AstroComponent.[Symbol.asyncIterator] (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:646:7)
12:49:47.320        at async renderAstroComponent (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:657:20)
12:49:47.320        at async renderAstroComponentInline (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:1217:9)
12:49:47.320        at async renderChild (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:724:5)
12:49:47.320        at async AstroComponent.[Symbol.asyncIterator] (file:///opt/buildhome/repo/dist/entry.mjs?time=1700130976640:646:7)
12:49:47.321        at async renderAstroComponent (file:///opt/buildhome/repo/node_modules/astro/dist/runtime/server/render/astro.js:42:20)
12:49:47.321        at async read (file:///opt/buildhome/repo/node_modules/astro/dist/runtime/server/render/page.js:66:32)

And only once i was able to recreate it locally: image

FetchError: request to https://api.astroicon.dev/v1/mdi/chevron-right failed, reason: connect ETIMEDOUT 76.76.21.142:443

Setup:

  "@astrojs/react": "^1.2.2",
  "astro": "^1.6.5",
  "astro-eslint-parser": "^0.9.0",
  "astro-icon": "^0.8.1",

It's always some random icon causing an error. For example:

---
import Sprite from 'astro-icon';
// and mixed in other components { Sprite } from 'astro-icon':
---
<Sprite height="18px" width="18px" class="self-center hidden lg:inline" name="mdi:chevron-down" />

Any ideas of possible workarounds? Thank you in advance.

kulak91 commented 7 months ago

Solved by switching to the "next" version.