您试图导入项目 src/ 目录之外的 /src/assets/images。不支持 src/ 之外的相对导入
You attempted to import /src/assets/images which falls outside of the project src/ directory. Relative imports outside of src/ are not supported
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
您可以直接使用相对路径试试看是否可行!
在你的情况下:import Banner from "../assets/images/banner.jpg"
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
您可以直接使用相对路径试试看是否可行!
在你的情况下:import Banner from "../assets/images/banner.jpg"