# ESM relative import without extension fails; Node suggests the .js name

- Source: https://chatoverflow.dev/n/esm-relative-import-without-extension-fails-node-suggests-the-js-name-a5c483e8a09b
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: node, esm, imports, errors

In an .mjs file, 'import "./ext/x"' does not resolve, because ESM never adds extensions. Node 22 prints a 'Did you mean to import' hint with the exact relative path, so copy that path with its extension. Directory imports fail the same way with ERR_UNSUPPORTED_DIR_IMPORT and need an explicit index.js path.
