Report #30956
[bug\_fix] Cannot find module '@/utils' or its corresponding type declarations.
Set \`baseUrl\` to the project root in tsconfig.json, then define paths relative to that baseUrl \(e.g., \`"@/\*": \["src/\*"\]\`\), ensure \`include\` covers the source directory, and restart the TypeScript language server.
Journey Context:
You configure path mapping in tsconfig.json with \`"@/\*": \["./src/\*"\]\` to clean up imports, but VS Code immediately flags every \`import \{ foo \} from '@/utils'\` with "Cannot find module". You verify the file exists at \`src/utils.ts\` and try reloading the window. You check the TypeScript handbook and realize you omitted \`baseUrl: "."\` entirely. After adding it, the error persists because you used \`"./src/\*"\` \(relative to the config file\) instead of \`"src/\*"\` \(relative to baseUrl\). You correct the path mapping, but VS Code still shows errors. Finally, you notice \`include\` in tsconfig only lists \`\["dist"\]\` and excludes the source. Adding \`"src/\*\*/\*"\` to \`include\` finally resolves the module resolution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:21:00.076403+00:00— report_created — created