Aorio
Aorio

Reputation: 73

SCSS file error: File to import not found or unreadable: bootstrap

I am trying to set up a site ran on Jekyll I haven't updated in awhile (obviously my developer skills are very rusty in general) with Github Pages. Whenever I try, I get this error: Your site is having problems building: Your SCSS file sass/about.scss has an error on line 1: File to import not found or unreadable: default. Load paths: _sass /hoosegow/.bundle/ruby/2.4.0/gems/minima-2.1.1/_sass. For more information, see https://help.github.com/articles/page-build-failed-invalid-sass-or-scss/.

All my scss pages like about.scss start with this:

---
---

@import "default";

or

---
---

@import "bootstrap";

I have made sure that my config.yml file has this:

sass:
  sass_dir: ./_sass

and I am not sure what to do from here.

Upvotes: 7

Views: 39177

Answers (4)

Ula
Ula

Reputation: 2748

GitHub ACTIONS CI has thrown this error.

I found that I did not add webpack-dev-server.

I added it as follows and it helped:

    - name: Add webpack-dev-server
      run: |
        yarn add webpack-dev-server
    - name: Build App
      ...

Upvotes: 0

Rishi Kumar
Rishi Kumar

Reputation: 11

Just change the file name. For Example: if your file name is navbar.scss then change it to _navbar.scss and import will remain the same as => @import './styles/navbar'; (assuming the scss file is in your styles folder)

Don't forget to restart the server.

Upvotes: 1

Kyle
Kyle

Reputation: 302

I was able to fix this error by creating the imported stylesheets (eg. _scss/_default.scss) using cmd.

For example: NUL > _default.scss

Be careful not to overwrite any existing files.

Upvotes: 1

Litty
Litty

Reputation: 1876

Looks like you're missing a pretty big hint!

File to import not found or unreadable: default

It's looking for a file called default.scss and is unable to do so. Make sure the file exists in the sass_dir you configured and doesn't have any weird read-permissions on it (e.g. can you open the file in another program?).

Upvotes: 5

Related Questions