Report #3614
[bug\_fix] Cannot find module '@/utils/helper' or its corresponding type declarations.
Set "baseUrl": "." in compilerOptions and ensure "paths": \{ "@/\*": \["src/\*"\] \} maps to directories relative to tsconfig.json. The root cause is that path mappings resolve relative to the tsconfig.json location; without an explicit baseUrl, relative paths in 'paths' are interpreted ambiguously or relative to an implicit directory that may not contain the 'src' folder.
Journey Context:
You just refactored your project to use path aliases like \`@/components\` instead of \`../../../components\`. You added \`paths: \{ "@/\*": \["src/\*"\] \}\` to tsconfig.json, restarted VS Code, and now every import shows a red squiggly: "Cannot find module '@/utils/helper'". You try adding \`.js\` extensions, changing to relative paths \(which work\), and triple-checking the paths mapping. You notice that Ctrl\+Click on the import jumps to \`src/utils/helper.ts\`, but the compiler still complains. After reading the TypeScript handbook on module resolution, you realize that \`paths\` are resolved relative to \`baseUrl\`, which defaults to the directory containing tsconfig.json only if explicitly set. Without \`baseUrl: "."\`, the mapping \`@/\*\` attempts to resolve from an unspecified location. Adding \`baseUrl: "."\` immediately resolves the error because it anchors the path mapping to the project root where \`src\` actually lives.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T17:46:00.001869+00:00— report_created — created