Giter Site home page Giter Site logo

Comments (15)

stackblitz avatar stackblitz commented on May 20, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

from unplugin-icons.

userquin avatar userquin commented on May 20, 2024

it seems another problem, we're using camelToKebab and the resolver should be fine:

imagen

from unplugin-icons.

bbugh avatar bbugh commented on May 20, 2024

Hey @userquin. Your example shows you accidentally passing kebab case in to camelToKebab. If you pass the actual camel case in, you can see the issue reproduced.

image

I don't believe the problem is the conversion back from camel case, it's the conversion from kebab case to camel case. It is losing precision in the conversion process because camelCase doesn't have a separator that can delimit sequential numbers.

image

from unplugin-icons.

olemarius avatar olemarius commented on May 20, 2024

I just upgraded from 0.16.5 to 1.17.1 and got errors for any icons containing : such as

<icon-heroicons-outline:terminal

[unplugin-icons] Could not load ~icons/heroicons/terminal (imported by src/components/mycomponent.vue?vue&type=script&setup=true&lang.ts): Icon heroicons/terminal not found
@bloc/frontend:preview: error during build:

from unplugin-icons.

userquin avatar userquin commented on May 20, 2024

@olemarius can you fork this SB repro https://stackblitz.com/fork/github/unplugin/unplugin-icons/tree/userquin/docs-add-stackblitz-links/examples/vite-vue3 and add a reproduction?

EDIT: I guess we also need to fix the compiler.

from unplugin-icons.

olemarius avatar olemarius commented on May 20, 2024

@olemarius can you fork this SB repro https://stackblitz.com/fork/github/unplugin/unplugin-icons/tree/userquin/docs-add-stackblitz-links/examples/vite-vue3 and add a reproduction?

EDIT: I guess we also need to fix the compiler.

Thanks, managed to track down what caused it. Seems to be the componentPrefix: 'icon', option here:

https://stackblitz.com/edit/unplugin-unplugin-icons-8kzqtn?file=vite.config.ts

from unplugin-icons.

userquin avatar userquin commented on May 20, 2024

@olemarius you've installed heroicons, install heroicons-outline instead

imagen

or use icon-heroicons:command-line:

imagen

In the meantime, import the icon manually: https://stackblitz.com/edit/unplugin-unplugin-icons-g3be2f?file=App.vue

from unplugin-icons.

userquin avatar userquin commented on May 20, 2024

it seems a problem with unplugin-vue-components and/or unplugin-auto-import

from unplugin-icons.

olemarius avatar olemarius commented on May 20, 2024

Yea I can always apply a refactor/workaround to fix the problem, but it's a huge project where we use a lot of different icons and they've worked fine before. So I wouldn't expect regressions from upgrading unplugin-icons. To me it seems like the rewrite of : to - is somehow not playing nicely when the componentPrefix option is used.

from unplugin-icons.

userquin avatar userquin commented on May 20, 2024

@olemarius I'll try to fix the problem, or add an option to enable old : behavior if cannot be fixed here

from unplugin-icons.

bbugh avatar bbugh commented on May 20, 2024

I'm confused about this thread as it doesn't seem like the conversation happening now is related at all to the original issue I reported above.

from unplugin-icons.

userquin avatar userquin commented on May 20, 2024

@bbugh upps, you're right, checking your use case... I'll remove this issue from the PR

from unplugin-icons.

userquin avatar userquin commented on May 20, 2024

@bbugh it seems a problem with unplugin-vue-components/unplugin-auto-import, adding this importPathTransform hook to the Components plugin works:

    Components({
      dts: true,
      importPathTransform(path) {
        return path === '~icons/fluent/speaker224-regular' ? '~icons/fluent/speaker2-24-regular' : path
      },
      resolvers: [
        IconsResolver({
          alias: {
            park: 'icon-park',
          },
          customCollections: ['custom', 'inline'],
        }),
      ],
    }),

imagen

from unplugin-icons.

bbugh avatar bbugh commented on May 20, 2024

Ahhh, thanks for the workaround! That's helpful.

from unplugin-icons.

firmianaQ avatar firmianaQ commented on May 20, 2024
<icon-mingcute-calendar-2-line/>
Icon `mingcute/calendar2-line` not found

from unplugin-icons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.