Skip to content

allowImportingTsExtensions not working with transpileOnly #1981

@lmiller1990

Description

@lmiller1990

Search Terms

transpileOnly, allowImportingTsExtensions, typescript 5

Possibly related: #1978

Expected Behavior

allowImportingTsExtensions working with transpileOnly

Actual Behavior

Should work (I think?)

Steps to reproduce the problem

  • ✅ Works: NODE_OPTIONS="--loader ts-node/esm" node index.ts
  • ❌ Does not work: NODE_OPTIONS="--loader ts-node/esm/transpile-only" node index.ts

Minimal reproduction

https://github.com/lmiller1990/ts-node-transpile-error

Specifications

ts-node v10.9.1
node v16.19.1
compiler v5.0.2

{
  "compilerOptions": {
    "allowImportingTsExtensions": true,
    "module": "ES2015",
    "noEmit": true
  }
}


  • package.json:
{
  "type": "module",
  "name": "tsnode",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "ts-node": "^10.9.1",
    "typescript": "^5.0.2"
  }
}

  • Operating system and version: macos ventura

  • If Windows, are you using WSL or WSL2?:

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