Skip to content

NX monorepo with paths do not work out of box or with modifications #1165

Closed
@kbrilla

Description

@kbrilla

Example NX repository with 1 angular app and 1 non buildable non publishable lib

Provided repository have few commits with few configurations that all work on non GO typescript language server.

  1. out of box with lib:
{
 "compileOnSave": false,
 "compilerOptions": {
   "rootDir": ".",
   "sourceMap": true,
   "declaration": false,
   "moduleResolution": "node",
   "emitDecoratorMetadata": true,
   "experimentalDecorators": true,
   "importHelpers": true,
   "target": "es2015",
   "module": "esnext",
   "lib": ["es2020", "dom"],
   "skipLibCheck": true,
   "skipDefaultLibCheck": true,
   "baseUrl": ".",
   "paths": {
     "@org-test/test-lib-a": ["libs/src/index.ts"]
   }
 },
 "exclude": ["node_modules", "tmp"]
}
  1. no baseUrl
{
  "compileOnSave": false,
  "compilerOptions": {
    "rootDir": ".",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "module": "esnext",
    "lib": ["es2020", "dom"],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "paths": {
      "@org-test/test-lib-a": ["./libs/src/index.ts"]
    }
  },
  "exclude": ["node_modules", "tmp"]
}
  1. moduleResolution bundler
{
  "compileOnSave": false,
  "compilerOptions": {
    "rootDir": ".",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "bundler",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "module": "esnext",
    "lib": ["es2020", "dom"],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "paths": {
      "@org-test/test-lib-a": ["./libs/src/index.ts"]
    }
  },
  "exclude": ["node_modules", "tmp"]
}
  1. "moduleResolution": "bundler", + "module": "preserve",
{
  "compileOnSave": false,
  "compilerOptions": {
    "rootDir": ".",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "bundler",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "module": "preserve",
    "lib": ["es2020", "dom"],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "paths": {
      "@org-test/test-lib-a": ["./libs/src/index.ts"]
    }
  },
  "exclude": ["node_modules", "tmp"]
}

All of above do not work on typescript-go but work on typescript.

If this is configuration problem please provide working configuration and reason why it won't work in ts-go

tested with @typescript/native-preview 7.0.0-dev.20250611.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Module ResolutionRelated to module resolution and module checker errorsDomain: tsconfigRelated to tsconfig parsing, loading

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions