[sage9] yarn build fails when using a .webp file in css?

My css is:

.no-webp .background {
  background-image: url('../images/branded-gradient.jpg');
}

.webp .background {
  background-image: url('../images/branded-gradient.webp');
}

yarn build resuls in:

 ERROR  Failed to compile with 2 errors                                                                3:41:12 PM

 error  in ./resources/assets/styles/main.scss

Module build failed: ModuleParseError: Module parse failed: Unexpected character '' (1:4)
You may need an appropriate loader to handle this file type.

Commenting out the .webp line and running yarn build again results in a successful build. Do I need to install a new loader “You may need an appropriate loader to handle this file type” this suggests? Could anyone point me in the right direction?

Many thanks!

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.