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

Can't get auto import of NuxtIcons to work #467

Open
5 tasks done
lud-hu opened this issue Jan 16, 2024 · 0 comments
Open
5 tasks done

Can't get auto import of NuxtIcons to work #467

lud-hu opened this issue Jan 16, 2024 · 0 comments

Comments

@lud-hu
Copy link

lud-hu commented Jan 16, 2024

Describe the bug

I'm currently trying to integrate storybook into an existing nuxt project. It sounds easy but actually there aren't any working plugins/libs for this (at least none that is still maintained and working) so I'm trying to figure it out myself.
Storybook itself runs fine but it fails as soon as I want to use an auto imported component, e.g. <NuxtIcon />.

For this I try to set up the unplugin-auto-import and according to the docs it should work like this:

    AutoImport({
      imports: [
        "vue",
        "vue-router",
        {
          "nuxt-icons": ["NuxtIcon", ["default", "NuxtIcon"]],
        },
      ],
      dirs: ["../composables"],
      vueTemplate: true,
    }),

Unfortunately it isn't. Is this a bug? Any ideas how to properly set this up?

Reproduction

https://github.com/lud-hu/nuxt-storybook-auto-import-repro

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M1
    Memory: 55.63 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - /opt/homebrew/opt/node@18/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.2.3 - /opt/homebrew/opt/node@18/bin/npm
  Browsers:
    Chrome: 120.0.6099.216
    Edge: 120.0.2210.133
    Safari: 17.0

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
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

1 participant