Report #38219
[bug\_fix] Cannot find module '@app/utils' or its corresponding type declarations. ts\(2307\)
Add \`"baseUrl": "."\` \(or the project root\) to \`compilerOptions\` in tsconfig.json. Ensure \`paths\` values are relative to this \`baseUrl\` \(e.g., \`"@app/\*": \["src/\*"\]\`\) so TypeScript can resolve the physical location of the aliased modules.
Journey Context:
You refactored a growing codebase to use path aliases like \`import \{ helper \} from '@app/utils'\` instead of fragile \`../../../utils\` relative paths. You added \`"paths": \{ "@app/\*": \["src/\*"\] \}\` to tsconfig.json, but VS Code immediately underlines the import with TS2307. You verify the file exists at \`src/utils.ts\`. You try restarting the TypeScript server, then the entire IDE. You search the error online and find GitHub issues explaining that \`paths\` is resolved relative to \`baseUrl\`, not the tsconfig location. You inspect your config and realize \`baseUrl\` is missing entirely. You add \`"baseUrl": "."\` to \`compilerOptions\`. Instantly, the red squiggle vanishes and IntelliSense resolves the alias correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:37:51.372705+00:00— report_created — created