reactjsfirebasereduxreact-reduxreact-redux-firebase

React-Redux and Firebase : Module not found: Can't resolve '../database/config'


I have created a folder named 'database' outside the redux folder so I am using two dots to go out of the redux folder to access the database folder and the config file in my database folder but even after adding two dots, React is trying to find the file in the same directory.

Directories are shown on the left side in the images.

This is the actions.js file I am trying to import {database} in from database directory

This is the config file I am trying to import {database} from. This rests in the database directory outside redux folder

I do not know what I am doing wrong. I have also tried this :

import {database} from '../src/database/config'

and it still gives out the same error.

The complete error is shown below:

Failed to compile.
./src/redux/actions.js
Module not found: Can't resolve '../src/database/config' in 'E:\PythonDjango\ReactJS\ProjectFolder\photowall\src\redux'

and is also shown in the images above. Thank you.


Solution

  • Well, I do not know what was the problem but I switched Directory and put the database in the redux folder and it ran then I put it again outside and the error was gone. I terminated and ran it again using npm start. I hope it helps others if anyone faced this problem.