Skip to content

nuxi typecheck does not works with alias imports (server) #455

Closed as duplicate

Description

@Barbapapazes

Hello,

You can reproduce by using this repo: https://github.com/Barbapapazes/nuxt-typecheck.

Without the #import, no errors are reported but by adding #import alias (from the generated tsconfig.json), the tsc fails with this error:

> nuxt-app@ typecheck /Users/esoub/dev/p/nuxt-typecheck
> nuxt typecheck

server/api/index.ts:1:10 - error TS2305: Module '"#imports"' has no exported member 'useNitroApp'.

1 import { useNitroApp } from "#imports";
           ~~~~~~~~~~~


Found 1 error in server/api/index.ts:1


 ERROR  Command failed with exit code 2: npx -p vue-tsc -p typescript vue-tsc --noEmit 

Activity

  1. Barbapapazes commented on Jul 31, 2024

    @Barbapapazes
    Author

    This issue is also present in the module template and seems to be related to the server part.

  2. changed the title [-]`nuxi typecheck` does not works with alias imports[/-] [+]`nuxi typecheck` does not works with alias imports (server)[/+] on Jul 31, 2024
  3. RafalKornel commented on Aug 20, 2024

    @RafalKornel

    Any updates? I also encountered this issue, where with "typescript.typeCheck": true inside nuxt.config.ts nuxt throws errors about not finding imports inside #imports alias... But types are picked up correctly from my IDE...

      "dependencies": {
        "nuxt": "^3.12.4",
        "vue": "^3.4.38"
      },
      "devDependencies": {
        "typescript": "^5.5.4",
        "vue-tsc": "^2.0.29"
      }
    
  4. OrbisK commented on Jun 20, 2025

    @OrbisK
    Member

    maybe related to #323

  5. danielroe commented on Jun 27, 2025

    @danielroe
    Member

    let's track in nuxt/nuxt#29263

    (nuxt typecheck should worth with projects going forwards)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions