Skip to content
Discussion options

You must be logged in to vote

the 'Module not found' error with TypeScript often occurs due to incorrect path aliases or module resolution issues.
first, check your tsconfig.json to ensure the baseUrl and paths are set correctly, like this:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@components/*": ["components/*"]
    }
  }
}

then, verify that your import path matches, e.g., import MyComponent from '@components/MyComponent'. also, ensure the folder and file names are correct (case-sensitive). restart your dev server with npm run dev after changes. If the issue persists, check for typos in the file path or run tsc --noEmit to catch TypeScript errors.

Feel free to ask any questions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TheBrazillianGuy
Comment options

Answer selected by TheBrazillianGuy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants