Skip to content

Object literal may only specify known properties, and 'mdi' does not exist in type #293

Open

Description

@Maxttier
vuetify: {
    vuetifyOptions: {
      icons: {
        defaultSet: 'mdi',
        aliases,
        sets: {
          custom,
          mdi,
        },
      },
    },
Object literal may only specify known properties, and 'mdi' does not exist in type 'IconFontName[] | FontIconSet[]'.ts(2353)
(property) mdi: IconSet

https://nuxt.vuetifyjs.com/guide/
https://vuetifyjs.com/en/features/icon-fonts/#usage

Activity

  1. Maxttier commented on Dec 2, 2024

    @Maxttier
    Author

    [{ name: 'mdi'}, { name: 'custom', ???????????????}

  2. Maxttier commented on Dec 2, 2024

    @Maxttier
    Author

    Object literal may only specify known properties, and 'aliases' does not exist in type 'IconsOptions'.

  3. Maxttier commented on Dec 2, 2024

    @Maxttier
    Author
    interface IconsOptions {
        /**
         * @default 'mdi'
         */
        defaultSet: IconSetName;
        /**
         * The prefix for UnoCSS Preset Icons.
         *
         * @default 'i-'
         */
        unocssIconPrefix?: string;
        /**
         * Override the default mdi icons.
         *
         * Icon names should include the prefix and the collection, for example:
         * - home: i-<collection>:<icon>
         */
        unocssIcons?: UnoCCSMdiIconSet;
        unocssAdditionalIcons?: Record<string, string>;
        sets?: IconFontName | IconFontName[] | FontIconSet[];
        svg?: {
            mdi?: JSSVGIconSet;
            fa?: FontAwesomeSvgIconSet;
        };
    }
    
  4. modified the milestones: 1.0.0, 2.0.0 on Jun 7, 2026
  5. AndreyYolkin commented on Jun 13, 2026

    @AndreyYolkin
    Contributor

    Moving this to the 2.0.0 milestone (the statically-analysable config rewrite). This is the same root cause as #72: the module's icons.sets is a font-import shorthand (IconFontName | IconFontName[] | FontIconSet[]), not Vuetify's Record<string, IconSet> object map, and the static config can't express function/component aliases (IconValue) — both are inherent to the current Vite-plugin + JSON-serialization architecture.

    In the v2 rewrite (see vuetify-nuxt-module-nuxt-v4), configuration moves to a real vuetify.config.ts via defineVuetifyConfiguration, so you pass native Vuetify icon options directly — object-map sets and function/component aliases work as documented. That resolves both #293 and #72 at the source rather than via a 1.0.0 type patch.

  6. Koa-wang commented on Oct 15, 2026

    @Koa-wang

    Hi @userquin, I'd like to fix this.

    A quick question before I start: should the sets type mirror Vuetify's own IconsOptions['sets'] directly (re-exporting from vuetify), or does this module intentionally define its own narrower type for the Nuxt config layer?

    If it's meant to mirror upstream, I can just re-export the type from vuetify and add aliases. If it's intentionally narrower, I'd need to understand the reasoning to extend it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: iconsIcon sets & icon configarea: typesTypeScript typesbugSomething isn't workingpriority: p3: mediumMedium: workaround exists or narrow case

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions