Skip to content

@vue/compiler-sfc unable to resolve external types in other vue components if using import map in package.json #13586

Open
@kalvenschraut

Description

@kalvenschraut

Vue version

3.5.17

Link to minimal reproduction

https://github.com/RTVision/vue-import-map-type-resolution

Steps to reproduce

clone repo and run pnpm build.

What is expected?

I expect the build to pass.

What is actually happening?

Error about unable to resolve import

Image

System Info

System:
    OS: Linux 6.12 Alpine Linux
    CPU: (16) x64 QEMU Virtual CPU version 2.5+
    Memory: 28.61 GB / 31.35 GB
    Container: Yes
    Shell: 5.2.37 - /bin/bash
  Binaries:
    Node: 22.16.0 - /usr/bin/node
    npm: 11.3.0 - /usr/bin/npm
    pnpm: 10.12.4 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chromium: 138.0.7204.93
  npmPackages:
    vue: ^3.5.17 => 3.5.17

Any additional comments?

What is interesting is if the import is from a typescript file it works just as demonstrated in https://github.com/RTVision/vue-import-map-type-resolution/blob/master/src/components/TheWelcomeUsesTsFile.vue

Also my editor can resolve the type import just fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions