File to import not found or unreadable


I am trying to deploy my site and I am getting error:

6:09:05 PM: @import “components/why.scss”;
6:09:05 PM: ^
6:09:05 PM: File to import not found or unreadable: components/why.scss.
6:09:05 PM: in /opt/build/repo/src/styles/global.scss (line 14, column 1)

It works on my local version without any error.

dtb 2020-04-05 at 18.12.40

That error usually means that either the file isn’t where you’re telling the system it is (so it cannot be imported), or that there is something wrong with the file so the import function cannot pull in its contents.

If you’re certain the file exists and is valid SCSS, then double-check the path.

There most common reason that things run locally but not remotely is due to errors in path specification.

Because you’re using a relative path, and for deployment you always should to use absolute path.

Correct import path:
@import “./components/why.scss”;