search

Home  >  Q&A  >  body text

Error: resolve-url-loader: Error processing CSS, expecting 'base' to be an absolute path to a valid directory

I'm trying to set a background image on my React app.

When I try to import an image using React and style it in JSX, it works, but when I try to put it directly into scss, it shows this error.

This is the CSS:

This is the error I get:

P粉005105443P粉005105443330 days ago339

reply all(1)I'll reply

  • P粉276577460

    P粉2765774602024-02-18 09:36:59

    url encoding in sass will convert your spaces to " " which does not exist in the real url. So spaces don't work in scss. I think this was a mistake. You can use "-" instead of a space in the word "Home".

    reply
    0
  • Cancelreply