Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowImportingTsExtensions not working with transpileOnly #1981

Closed
lmiller1990 opened this issue Mar 30, 2023 · 4 comments
Closed

allowImportingTsExtensions not working with transpileOnly #1981

lmiller1990 opened this issue Mar 30, 2023 · 4 comments

Comments

@lmiller1990
Copy link

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?:

@andrewbranch
Copy link

Should be fixed by microsoft/TypeScript#53599

@lmiller1990
Copy link
Author

lmiller1990 commented Apr 6, 2023

Yep, let's wait for TS 5.1 and verify.

Similar but unrelated? #1987

@andrewbranch
Copy link

Yes, it’s the same, and both will be fixed in a patch release 5.0.4 ~this week.

@lmiller1990
Copy link
Author

Yep, it's fixed in 5.0.4 which is now out, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants