Skip to content

Conversation

@adamdehaven
Copy link
Contributor

@adamdehaven adamdehaven commented Jan 7, 2026

Created a reproduction for the bug introduced by version 0.16.0

Bug

When component prop types are imported from aliased directories, e.g. #imports or #shared/path-to-interface either in the component itself, or even in the types file, the interfaces are not resolved and reflected in nuxt-component-meta.

This was working prior to the 0.16.0 release

The issue stems specifically from this block that was added in src/parser/meta-parser.ts:

// src/parser/meta-parser.ts

compilerOptions: {
  // Ensure Nuxt virtual aliases like '#build' resolve for type analysis
  baseUrl: outputDir,
  paths: {
    "#build": ["."],
    "#build/*": ["*"],
  }
},

If I remove this block, everything works 💚

Reproduction

Inspect the prop setup for playground/app/components/global/Button.vue and run pnpm dev. You'll notice the following output in the playground with empty meta[property] arrays:

"Button": {
    "mode": "all",
    "global": true,
    "prefetch": false,
    "preload": false,
    "filePath": "app/components/global/Button.vue",
    "declarationPath": "/Users/adam/Dev/nuxt-component-meta/playground/app/components/global/Button.vue",
    "pascalName": "Button",
    "kebabName": "button",
    "chunkName": "components/button",
    "priority": 1,
    "_scanned": true,
    "meta": {
      "type": 1,
      "props": [],
      "slots": [],
      "events": [],
      "exposed": [],
      "hash": "V-PkAurq568OfqXY9sEvxIR-OzZQglNgtkVP1e1nyNA"
    }
  },

If you then inspect the playground/app/components/global/ButtonInlineProps.vue and it's output, you'll notice that we are partially fixed for the props that are defined in playground/shared/types/button-inline-props.ts other than the imported SharedProps, which are showing the incorrect type here (search for SharedProps in the code below):

"ButtonInlineProps": {
    "mode": "all",
    "global": true,
    "prefetch": false,
    "preload": false,
    "filePath": "app/components/global/ButtonInlineProps.vue",
    "declarationPath": "/Users/adam/Dev/nuxt-component-meta/playground/app/components/global/ButtonInlineProps.vue",
    "pascalName": "ButtonInlineProps",
    "kebabName": "button-inline-props",
    "chunkName": "components/button-inline-props",
    "priority": 1,
    "_scanned": true,
    "meta": {
      "type": 1,
      "props": [
        {
          "name": "appearance",
          "global": false,
          "description": "",
          "tags": [],
          "required": false,
          "type": "string",
          "schema": "string",
          "default": "\"default\""
        },
        {
          "name": "size",
          "global": false,
          "description": "",
          "tags": [],
          "required": false,
          "type": "SharedProps",
          "schema": {
            "kind": "array",
            "type": "SharedProps",
            "schema": {}
          },
          "default": "\"medium\""
        }
      ],
      "slots": [
        {
          "name": "default",
          "type": "{}",
          "description": "",
          "schema": {
            "kind": "object",
            "type": "{}",
            "schema": {}
          }
        }
      ],
      "events": [],
      "exposed": [
        {
          "name": "$slots",
          "type": "Readonly<InternalSlots> & { default?: ((props: {}) => any) | undefined; }",
          "description": "",
          "schema": {
            "kind": "object",
            "type": "Readonly<InternalSlots> & { default?: ((props: {}) => any) | undefined; }",
            "schema": {
              "default": {
                "name": "default",
                "global": false,
                "description": "",
                "tags": [],
                "required": false,
                "type": "((props: {}) => any) | undefined",
                "schema": {
                  "kind": "enum",
                  "type": "((props: {}) => any) | undefined",
                  "schema": {
                    "0": "undefined",
                    "1": {
                      "kind": "event",
                      "type": "(props: {}): any",
                      "schema": []
                    }
                  }
                }
              }
            }
          }
        },
        {
          "name": "size",
          "type": "SharedProps",
          "description": "",
          "schema": {
            "kind": "array",
            "type": "SharedProps",
            "schema": {}
          }
        },
        {
          "name": "appearance",
          "type": "string",
          "description": "",
          "schema": "string"
        }
      ],
      "hash": "MR_1c-o7h7pFVZ8JKx5fys_S3Lji9gaL6w51SGS3jw0"
    }
  },

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 9, 2026

npm i https://pkg.pr.new/nuxt-component-meta@106

commit: 6ecb55f

@farnabaz farnabaz marked this pull request as ready for review January 9, 2026 18:04
@farnabaz farnabaz changed the title chore: 0.16.0 bug reproduction [DO NOT MERGE] fix: improve meta and ignore native types Jan 9, 2026
@farnabaz farnabaz merged commit 11ee13e into nuxt-content:main Jan 9, 2026
2 checks passed
@adamdehaven adamdehaven deleted the chore/0.16.0-bug-reproduction branch January 9, 2026 18:22
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

Successfully merging this pull request may close these issues.

2 participants