Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random exit in cli mode #1882

Closed
FlatMapIO opened this issue Nov 16, 2022 · 2 comments
Closed

Random exit in cli mode #1882

FlatMapIO opened this issue Nov 16, 2022 · 2 comments

Comments

@FlatMapIO
Copy link
Contributor

Seems to be the problem of createCDNLoader function

 function fetchCollection(name: string) {
    if (!supportedCollection.includes(name))
      return undefined
    if (!cache.has(name))
      cache.set(name, $fetch(`${cdnBase}@iconify-json/${name}/icons.json`))
    return cache.get(name)!
  }

I'm not sure how $fetch is implemented, but i've tested the fetch in node and it probably doesn't work.

await fetch("https://esm.sh/@iconify-json/carbon/icons.json")

image

There is no problem running unocss with bun and testing the fetch function above

@FlatMapIO
Copy link
Contributor Author

It seems to be a node problem, bun and deno are working fine. nodejs/node#45419

I propose to raise $fetch to the try block to let the process know what happened when it exits

@sudongyuer
Copy link
Member

Nice catch, PR welcome bro ~

FlatMapIO added a commit to FlatMapIO/unocss that referenced this issue Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants