Search code examples
reactjsfirebasehosting

Getting Module not found error: when I run npm run build command while trying to host reactjs App on fire base


Module not found: Error: You attempted to import D:/errors/solve/src/firebaseConfig.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/

here's my project structure:enter image description here I'm inside solve folder while running the commands

I followed this steps:https://www.thapatechnical.com/2021/08/complete-react-website-with-firebase-by.html


Solution

  • I just moved my firebaseConfiguration.js into components folder and exported it from there instead from src this resolved the error