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

4

7

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.

Osteophyte answered 1/3, 2018 at 5:27 Comment(0)
T
5

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?).

Transcribe answered 1/3, 2018 at 5:38 Comment(1)
Thank you! I'm obviously braindead - I just needed to reinstall bootstrap by copying the correct directory and files into my code, as they went missing for some reason. I followed this guide veithen.github.io/2015/03/26/jekyll-bootstrap.html and it worked just fine. Thank you again!Osteophyte
H
1

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.

Harrington answered 12/7, 2019 at 12:52 Comment(0)
N
1

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.

Nahuatl answered 21/6, 2021 at 20:13 Comment(0)
S
0

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
      ...

Stainless answered 30/3, 2023 at 22:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.