Error AtlasError Documentation and Resolution

Node.js cannot load an unknown file extension

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension

The runtime loader does not know how to execute the imported file type. This commonly appears when a source file intended for a compiler, framework, or custom runner is passed directly to Node.

ERR_UNKNOWN_FILE_EXTENSIONmodules
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension
  • A file such as JSX or another nonstandard source format is executed without its required build step.
  • A development command uses a loader or runner that is missing in production.
  • The installed Node version lacks the expected support for the source file type.
  1. Read the extension and file path from the error, then check node --version and the package scripts. Reproduce the project-documented start command rather than substituting node for its runner.
  2. If the format needs transformation, compile it with the project toolchain and run the emitted JavaScript. Verify deployment includes the compiled output.
  3. For TypeScript, check the exact runtime's native support and limitations or use the project's supported TypeScript runner. Native stripping is not a complete substitute for a compiler.
  4. Do not merely rename a TypeScript, JSX, or data file to .js: renaming does not transform its syntax. Test the actual production entry point after the change.
Node.js Docs: ERR_UNKNOWN_FILE_EXTENSION