0

Failed to compile

./src/App.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/postcss-loader/src??postcss!./src/App.css) Error: Can't resolve 'public/images/camping.jpg' in 'C:\User...

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "PT Sans", sans-serif;
}

.home, .services, .products, .sign-up {
  display: flex;
  height: 90vh;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.services {
  background-image: url("public/images/camping.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #fff;
  font-size: 100px;
}

.products {
  background-image: url("public/images/camping.jpg");
  background-position: center;
  background-size: fill;
  background-repeat: no-repeat;
  color: #fff;
  font-size: 100px;
}

.sign-up {
  background-image: url("public/images/camping.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #fff;
  font-size: 100px;
}
Kuba
  • 1
  • The error message clearly says it can't find the image at `public/images/camping.jpg`, and it's searching for it locally (`'C:\User...`) on your disk... – T J Apr 29 '21 at 21:22
  • Refer this: https://stackoverflow.com/questions/65125891/cant-resolve-images-img-2-jpg-in-e-react-react-demo-src – Senku Jul 31 '21 at 07:47

0 Answers0