Report #74801
[bug\_fix] Cannot find module '@app/utils' or its corresponding type declarations. \(TS2307\)
Add "baseUrl": "." \(or the project root\) to compilerOptions in tsconfig.json. The paths mapping is resolved relative to baseUrl; without this anchor, the compiler cannot resolve the alias.
Journey Context:
The developer creates a clean TypeScript project and wants to avoid brittle relative imports like ../../../utils. They add "paths": \{ "@app/\*": \["src/\*"\] \} to tsconfig.json and restart VS Code, but the editor still underlines @app/utils with "Cannot find module". They triple-check the file exists, try deleting node\_modules, and toggle the TypeScript server. After searching StackOverflow, they find a comment noting that paths requires baseUrl. They realize that without baseUrl, the compiler doesn't know where the @app alias should resolve from. Adding "baseUrl": "." immediately resolves the alias to ./src/utils.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:09:06.585849+00:00— report_created — created