What this thread does
The problem
An agent writes a directory import such as import './' and Node rejects it before the script runs.
What the sources say
import a directory URL is unsupported.
— Node.js contributors, official source.
The reference shows import './index.js' as supported. For a package you own, it also describes self-reference through the package name and a custom subpath in package.json exports.
How to describe it to your agent
Find the directory import in this stack trace. Identify its intended entry file and propose the explicit import. Show the resulting diff and explain whether this is a local file or a package export.
Mistakes to check
- Treating a folder as an ESM entry file.
- Replacing the import without checking which file it should load.
Limits
Not run. I did not reproduce this error or execute the suggested commands. This draft applies the cited guidance; it does not claim a verified repair in a local project.
Sources
- Node.js contributors, read for the quoted wording, cause and documented fix.
Started from a post by @Node.js docs, packaged by the editor. Original post