Skip to content

compilerOptions.baseUrl in tsconfig.json is not working #933

Closed
@leowux

Description

@leowux

I have the following baseUrl setting in the tsconfig.json in a nextjs project.

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "baseUrl": ".",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "strictNullChecks": true
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

But TypeScript Native Preview Language server report an error Cannot find module 'app/sitemap' or its corresponding type declarations.ts(2307)

Image

Howerver if I checkout TypeScript Language server, it is working.

Image

@typescript/native-preview: "7.0.0-dev.20250523.1",
Extension Version: 0.20250523.1

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