Skip to content

doc: document '.' and '..' specifiers in ESM_RESOLVE algorithm#64412

Open
Phantom-d-e-v wants to merge 1 commit into
nodejs:mainfrom
Phantom-d-e-v:doc-39873-esm-resolver-dot-specifiers
Open

doc: document '.' and '..' specifiers in ESM_RESOLVE algorithm#64412
Phantom-d-e-v wants to merge 1 commit into
nodejs:mainfrom
Phantom-d-e-v:doc-39873-esm-resolver-dot-specifiers

Conversation

@Phantom-d-e-v

Copy link
Copy Markdown

The ESM_RESOLVE algorithm's relative-specifier step only mentioned specifiers starting with '/', './', or '../'. A bare '.' or '..' specifier is also treated as relative and resolves to a directory, throwing ERR_UNSUPPORTED_DIR_IMPORT (see lib/internal/modules/esm/resolve.js isRelativeSpecifier). Document this case so the spec matches the resolver.

Fixes: #39873

The ESM_RESOLVE algorithm's relative-specifier step only mentioned
specifiers starting with '/', './', or '../'. A bare '.' or '..'
specifier is also treated as relative and resolves to a directory,
throwing ERR_UNSUPPORTED_DIR_IMPORT (see lib/internal/modules/esm/resolve.js
isRelativeSpecifier). Document this case so the spec matches the resolver.

Fixes: nodejs#39873
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation. labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc: Error for "." and ".." specifiers differs from documented Resolver Algorithm

2 participants