Skip to content

Risk of accidentally registering both source-map-support and @cspotcode/source-map-support #1441

@ejose19

Description

@ejose19

Search Terms

source map
10.2.0

Expected Behavior

Log should point to example.ts:3

Actual Behavior

Log points to example.ts:4

Steps to reproduce the problem

  • Clone the repro repository
  • Run bash run.sh

Minimal reproduction

TypeStrong/ts-node-repros#17

Specifications

  • ts-node version: 10.2.0+
  • node version: 14.17.0 / 16.6.1
  • TypeScript version: 4.3.5 / 4.4.2
  • tsconfig.json, if you're using one:
{
  "compilerOptions": {
    "target": "ESNEXT",
    "module": "CommonJS",
    "strict": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}
  • Operating system and version: Archlinux

Additional context

I see that on https://github.com/TypeStrong/ts-node/releases/tag/v10.2.0 there was some changes to source map, probably causing this issue.

EDIT:

After reading #1440 & #1438, I see that this is issue is present due to using 2 different source-map-support libraries, however in this case it's a dependency (tslog) using the original source-map-support, how should users proceed in this case? I've confirmed that if I change the import in the dependency to require("@cspotcode/source-map-support"), it points to the correct line number, but that's not a practical solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions