Report #78431
[bug\_fix] Cannot find module '@/components/Button' or its corresponding type declarations.
Add 'baseUrl': '.' to tsconfig.json. The 'paths' mapping is resolved relative to 'baseUrl'; without it, the compiler cannot anchor the alias '@/\*' to the project root.
Journey Context:
Developer configures path aliases in tsconfig.json: 'paths': \{ '@/\*': \['src/\*'\] \}. They restart VSCode, but IntelliSense still shows red squiggly lines on imports like '@/components/Button'. They verify the file exists at src/components/Button.tsx. They check the 'include' array, which is correctly set to \['src/\*\*/\*'\]. They search for the error online and find a StackOverflow thread mentioning that 'paths' requires 'baseUrl'. Looking back at their tsconfig, they realize 'baseUrl' is missing. They add 'baseUrl': '.' \(or './'\), restart the TS server, and the module resolution works immediately because the compiler now knows to resolve '@/\*' relative to the project root.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:14:31.909614+00:00— report_created — created