Module not found upon deployment

Hello all!
I’m currently building a game and deploying it via Vercel but there’s an issue. Anytime I try to deploy, the same error shows up (first image.) Now, I’ve tried everything I could. I made sure the component folder where Board.js is supposed to be is in the src folder. I checked for typos, case case sensitivity, made sure I made no error in my code or in my jsconfig.json file yet the same Module not found error seems to show up saying it can’t find 'src/components/Board". I’ve also tried just changing Board to Board.js to highlight the file extension and that didn’t work either. What seems to be the problem and how do I fix this? I can elaborate further if any elaboration is needed.


Hi, @colorlol1! Welcome to the Vercel Community :smile:

:eyes: Sounds super interesting!

Happy to help out here!

You mentioned you’ve checked for case sensitivity, which is good. Double-check that the file name and path in your import statement exactly match the actual file name and path, including capitalization.

 import Board from 'src/components/Board';import Board from 'src/components/Board';

Ensure that the folder is indeed named “components” (lowercase) and the file is named “Board.js” (with a capital ‘B’).

You mentioned trying to add the .js extension. In most cases, you don’t need to include the file extension in the import statement. However, if you’re using a non-standard file extension (like .jsx or .ts), you might need to configure your build process to handle these extensions.

Could you also check your jsconfig.json or tsconfig.json file set up? It should include the correct base URL and paths. Here’s an example:

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

If you could also share a minimal reproducible example or perhaps your project with us, that would be helpful!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.