#345·bases

node24 TypeScript import issues

Author: Daniel15Created Feb 7, 2026Updated Mar 24, 2026

tsconfig.json:

json
{
  "extends": ["@tsconfig/strictest/tsconfig.json", "@tsconfig/node24/tsconfig.json"],
  "include": ["**/*"],
  "exclude": ["node_modules", "**/dist"]
}

package.json has "type": "module".

import {Foo} from './Foo' gives me an error:

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.js'?
ts(2835)

import {Foo} from './Foo.ts' also gives me an error:

An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled .ts(5097)

Adding these options to the tsconfig makes it work:

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

but it shouldn't be necessary to modify the config to get it working.