Skip to content

ts-node seems to fail to resolve dependencies in referenced projects #1381

@trinitrotoluene

Description

@trinitrotoluene

Expected Behavior

I would expect code that doesn't error when trying to compile it with tsc to compile when run through ts-node.

Actual Behavior

I get a TSError warning me about missing dependencies (the README linked below) when ts-node tries to load a referenced project.

Reproduction

I've created a minimal reproduction repo for my scenario here with the behaviour/stack trace and command to reproduce.

Specifications

  • ts-node version: 10.0.0
  • node version: 16.3.0
  • TypeScript version: 4.3.4
  • tsconfig.json, if you're using one:
    please see the reproduction repo for the tsconfig structure, here is the effective tsconfig:
{
  "compilerOptions": {
    "noEmit": false,
    "paths": {
      "@org/liba": [
        "a/liba"
      ]
    },
    "esModuleInterop": true,
    "target": "es2017",
    "resolveJsonModule": true,
    "moduleResolution": "node",
    "baseUrl": "../..",
    "rootDir": "../..",
    "outDir": "./.ts-node",
    "sourceMap": true,
    "inlineSourceMap": false,
    "inlineSources": true,
    "declaration": false,
    "module": "commonjs"
  },
  "references": [
    {
      "path": "../../a/liba"
    }
  ],
  "ts-node": {
    "cwd": "[SHORTENED]\\ts-node-repro\\b\\btest",
    "projectSearchDir": "[SHORTENED]\\ts-node-repro\\b\\btest",
    "require": [],
    "project": "[SHORTENED]/ts-node-repro/b/btest/tsconfig.json"
  }
}
  • Operating system and version:
    Windows 10 Pro 19043.1052
  • If Windows, are you using WSL or WSL2?: no

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions