Home > OS >  You attempted to import /src/assets/images which falls outside of the project src/ directory. Relati
You attempted to import /src/assets/images which falls outside of the project src/ directory. Relati

Time:04-15

Problem: My assets file is inside of src folder. But terminal showing error that my assets file is outside of src/. Which causes me unable to import images inside of my file \src\home\home.js

here is the picture of issue I'm facing

CodePudding user response:

You can just use the relative path and try if that works! in your case: import Banner from "../assets/images/banner.jpg"

  • Related