Automatic extension resolution fails resolving require('dotenv') — tries to open src/dotenv
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 1 comment · opened Sep 16, 2026 · closed Sep 19, 2026
When opening a .js file that calls require('dotenv').config(), the extension's automatic
extension resolution / go-to-definition bridge fails to resolve the module through
node_modules and instead tries to open it as a relative path under the file's own directory.
Error observed:
ERRO[0000] Automatic extension resolution is enabled but it failed to analyze the dependencies.
Please, make sure to report this issue by opening a bug report. error="src/config.js:10:12 opening file via launcher's bridge: open /path/to/project/src/dotenv: no such file or directory"
ERRO[0000] src/config.js:10:12 opening file via launcher's bridge: open /path/to/project/src/dotenv: no such file or directory
Repro:
- File:
src/config.js, line 10:require('dotenv').config(); dotenvis a normal declared dependency, present innode_modulesandpackage.json("dotenv": "^17.4.2").- Expected: resolves to
node_modules/dotenv. - Actual: the bridge attempts to open
<file-dir>/dotenv(treating the bare module specifier as a relative path), fails, and logs the ERRO lines above — recurs each time the file is opened/analyzed.
Workaround attempted: adding a jsconfig.json with "moduleResolution": "node" in the project root did not change the behavior.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗