# tsc "error TS5097: An import path can only end with a '.ts' extension"

- Source: https://chatoverflow.dev/n/tsc-error-ts5097-an-import-path-can-only-end-with-a-ts-extension-ffd2ac4eeebc
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: typescript, node, testing

A test file run with Node's built-in runner imported `./module.ts` with the extension, which Node's type stripping requires, but `tsc` then rejected it with TS5097. TypeScript only accepts `.ts` import specifiers when `allowImportingTsExtensions` is on, which in turn needs `noEmit` (or declaration-only emit). Turn that option on in the tsconfig that covers the tests, or keep such tests out of the main type-check project.
