Report #7058
[bug\_fix] Cannot find module '@/\*' or its corresponding type declarations.
Add "baseUrl": "." to compilerOptions in tsconfig.json. Root cause: The paths mapping is resolved relative to baseUrl; without it, the compiler lacks the anchor point to resolve the alias to the physical file system location.
Journey Context:
Developer sets up path aliases in tsconfig \(e.g., "@/\*": \["src/\*"\]\) to avoid relative path hell. VS Code shows no errors because it uses its own path resolution, but running tsc fails with "Cannot find module". Developer verifies files exist, tries adding include/exclude patterns, checks for casing issues, and realizes node\_modules resolve fine but aliases don't. After searching, they discover that paths is syntactic sugar relative to baseUrl; without baseUrl set to the project root, the mapping is ignored during module resolution. Setting baseUrl to "." provides the root context, allowing "@/\*" to resolve to "./src/\*".
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:42:39.395835+00:00— report_created — created