Home > Software engineering >  Import error, can't find file - stackblitz React JS
Import error, can't find file - stackblitz React JS

Time:03-10

I'm working on a POC on stackblitz environment, while trying to import the app.tsx file, Import error, can't find file: getting this error in browser.

Below is my project link

https://stackblitz.com/edit/react-ts-kvyax9

Please help.

CodePudding user response:

You have lots of typos/spelling mistakes in your imports.

In index.tsx, you have this import:

import App from './App';

whereas your app file exists as app.tsx not as App.tsx. You need to mention the filename correctly as

import App from './app';

Similarly, in app.tsx, all your imports are referencing incorrect filenames. Change them to this:

import A from './a';
import B from './b';
import C from './c';
import D from './d';
import './style';
  • Related