Skip to content

[plugin:vite:vue] [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type #14236

Closed

Description

@Rednas83

Vue version

3.5.26

Link to minimal reproduction

https://play.vuejs.org/#eNp9ksFOwzAMhl8lygmkaTvAqeomAdoBDjANboRDl3qlW5pEibsVVX13nGYt04QmVVXy+0/82U7LH6ydHmrgCU+9dKVFpjJdzAVHL/hCaGisccjaTmihc5Aqc8AKZTaZYq3QjOGPBWYslkZ7No8aY9LkkAybaEqYR1fqYtCsM9YnbA3SuDyNsQmr9V6bo6bM0eVBgUTIE7YxRkFGFEEmnP5HXzqL4HSENqciPGBtL0qRRIgxLYHmsC01rMIuPeF/Ch64Bf9a3NxeXoxQWZUh9GSpdbBo29NlXZfOghCOnNn4hDJT0m1ZTHfeaOpx35CQpbKlAvcW8wo+tkrwTClzfOk1dDVMBl1+g9z/o+98EzTBVw48uAPhjzHMXAEYw8v3V2hoPQYrk9eK3FeCa/BG1YEx2h5rnRP2ma+nfa7CG6Hxffhlg6D9UFQA7QfV+wWnh/Z0pfQ/3Lvp/TBg3v0CFs7jOg==

Steps to reproduce

Define global indexed type like (typicaly in types.d.ts but not supported in https://play.vuejs.org/)

declare global {
  type options = {
    code: {
      type: string
      props: Record<string, unknown>
      selected: boolean
    }
  }
}
  1. Use it anywhere to reproduce the error
Image

What is expected?

No error just like with older versions of vue.

What is actually happening?

An error happens because global index types don't seem to be supported anymore?

System Info

|                      |                                                                                                                                                             |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Operating system** | `Windows 10.0.26200`                                                                                                                                        |
| **CPU**              | `AMD Ryzen 9 PRO 8945HS w/ Radeon 780M Graphics (16 cores)`                                                                                                 |
| **Node.js version**  | `v24.11.1`                                                                                                                                                  |
| **nuxt/cli version** | `3.31.2`                                                                                                                                                    |
| **Package manager**  | `pnpm@10.24.0`                                                                                                                                              |
| **Nuxt version**     | `4.2.2`                                                                                                                                                     |
| **Nitro version**    | `2.12.9`                                                                                                                                                    |
| **Builder**          | `vite@7.2.7`                                                                                                                                                |
| **Config**           | `compatibilityDate`, `css`, `devtools`, `eslint`, `experimental`, `icon`, `modules`, `routeRules`, `vite`                                                   |
| **Modules**          | `@nuxt/eslint@1.12.1`, `@nuxt/ui@4.3.0`, `@nuxt/image@2.0.0`, `@nuxt/test-utils@3.21.0`, `@pinia/nuxt@0.11.3`, `@vueuse/nuxt@14.1.0`, `nuxt-charts@2.0.0`   |

Any additional comments?

My code base depends heavily on global indexed types. Can it be supported again just like before?

Activity

  1. coderabbitai commented on Dec 22, 2025

    @coderabbitai

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    Examples

    🔗 Similar Issues

    Possible Duplicates

    Related Issues

    🔗 Related PRs

    #13789 - fix(compiler-sfc): support global augments with named exports [merged]

    👤 Suggested Assignees

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord or schedule a call!

  2. edison1105 commented on Dec 23, 2025

    @edison1105
    Member

    Need to register global type files to the compiler, see #11014 (comment)

  3. Rednas83 commented on Dec 23, 2025

    @Rednas83
    Author

    All types were already working except indexed types like options['code'].

    Tried the suggested globalTypeFiles but no change
    nuxt.config.ts

    	vite: {
    		vue: {
    			script: {
    				globalTypeFiles: ["./shared/types/types.d.ts"] // ISSUE: Indexed types like options['code'] not supported https://github.com/vuejs/core/issues/14236#issuecomment-3684636798
    			}
    		},
    	},
    

    Not sure what changed but indexed types used to work. Can you have another look at the reproduction to see how the issue can be resolved?

  4. edison1105 commented on Dec 24, 2025

    @edison1105
    Member

    a workaround

    const props = defineProps</*@vue-ignore*/options["code"]>()
  5. added
    has workaround
    🔨 p3-minor-bug
    on Dec 24, 2025
  6. Rednas83 commented on Jan 10, 2026

    @Rednas83
    Author

    Seem to be resolved in my nuxt environment🚀 ...but it still happening in the Vue SFC Playground🤔

  7. locked and limited conversation to collaborators on Feb 3, 2026
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

    🔨 p3-minor-bughas workaroundscope: sfc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions