Error: File to import not found or unreadable: <style sheet>

Hello! Total newbie to GitHub and Jekyll here. Trying to develop and test my new GitHub Pages theme and style sheet locally on Windows for the first time, but when I go to serve, all I get is this error.

@import “tr-systems-modernist”; in assets/css/style.scss simply isn’t working for some very simple reason.

So instead of explaining what I’ve got and what I’ve done, would someone be so kind as to take a look at my website and the repo and see what might be amiss? Scroll down to the section on Testing on Windows. It’s all in there. Thanks!

Modernist Theme by TR-Systems

Could it have something to do with baseurl or lack thereof in my config? I tried baseurl=“” to no avail.

can you post the full log from when you try to run the command? just copy and paste it in here.

Also share a link to your repo if possible.

If you need baseurl and are not using it then you won’t get build errors but you likely will have 404 errors on css, images and any js depending on how you link to them.

Thanks, here’s the link to my repo and the first part of what serve spits back. It goes on with a lot more but I’m not sure how to post it all. The “SyntaxError” and subsequent 20-30 messages from various Jekyll modules also appears 3 times.

Next up for me is try it on my new ras pi 4, another adventure into the great unknown. :slight_smile:

$ bundle exec jekyll serve
Configuration file: C:/Users/thoma/documents/github/modernist/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: C:/Users/thoma/documents/github/modernist
       Destination: C:/Users/thoma/documents/github/modernist/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
                    File to import not found or unreadable: tr-systems-modernist. Load path: C:/Ruby32/lib/ruby/gems/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass on line 1
jekyll 3.9.5 | Error:  File to import not found or unreadable: tr-systems-modernist.
Load path: C:/Ruby32/lib/ruby/gems/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass on line 1
C:/Ruby32/lib/ruby/gems/3.2.0/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:123:in `rescue in convert': File to import not found or unreadable: tr-systems-modernist. (Jekyll::Converters::Scss::SyntaxError)
Load path: C:/Ruby32/lib/ruby/gems/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass on line 1

        raise SyntaxError, "#{e} on line #{e.sass_line}"
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        from C:/Ruby32/lib/ruby/gems/3.2.0/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:118:in `convert'

is this really where the file should be? it is looking for it there.

I don’t use gem based themes as they seem overly complicated to me. Are you planning on sharing this with others so they can use it or is this just for your self?

For a total newb you are trying to do some possibly difficult things, you may want to start with some simpler things first so you can understand the basics better.

No, it’s supposed to be looking in c:/users/thoma/documents/GitHub/modernist/_sass for import of style sheets like it does from the root of the modernist repo on GitHub.

I see now what the problem is, that Load Path does not exist in my installation of Ruby. I wonder why? There’s tons of other Jekyll gems in that path, but not this one.

I think I just need to install that gem, jekyll-theme-primer, but I don’t think I need it in my gem file. Will test tomorrow.

Also, I should stop calling my “theme” a theme. It’s just a website design based on a theme that you can copy and use.

For more on that, please visit my TR-Systems website! (just taking every opportunity I can to get some traffic on GA lol)

if you are not planning to share the theme as a gem that others could use I would not use a gem based theme. All a theme is really is the css, layouts, includes and maybe some other stuff. If you do a gem based theme all that stuff is hidden in a gem.

I find it to be simpler to just have all those files in the project I am working on. Then if you want to use it in another site just clone or fork it and strip out all the stuff you don’t need.

The results are in and I believe this is a BUG in Jekyll on Windows and has nothing to do with the structure of my repo or the design of the website, which is all by the book (GitHub and Jekyll doc).

The problem is: @import “tr-systems-modernist”; in site.source/assets/css/style.scss is simply not working. Jekyll is looking elsewhere and not finding it where it should be looking, which is site.source/_sass (by default).

That said, I did make one change to my config that made a change in the error being reported. By adding "theme: " to my config, the error is now coming from the sass-converter and not jekyll-theme-primer (which is a jekyll gem theme that it must have defaulted to with no theme defined in the config? strange behavior imho).

So now with theme set to null in my config, I get this.

      Generating...
  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
                    File to import not found or unreadable: tr-systems-modernist. on line 1
jekyll 3.9.5 | Error:  File to import not found or unreadable: tr-systems-modernist. on line 1
C:/Ruby32/lib/ruby/gems/3.2.0/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:123:in `rescue in convert': File to import not found or unreadable: tr-systems-modernist. on line 1 (Jekyll::Converters::Scss::SyntaxError)

Get it? I do. It’s a bug.

But I have a workaround that sucks, but also illustrates why the import isn’t working.

Replace the @import in assets/css/style.css with the contents of my two style sheets in _sass and the site builds and serves locally just fine.

Tis all for now. I’m moving over to my new ras pi and give that a shot. Thanks for your time!

are you saying you have css/sass files in the layouts directory? I don’t think that is supported. Sass files should be in the _sass directory which can be defined in the config if you want it somewhere else but I don’t think mixing it in with the layouts is a good idea or if it would even work…

sorry that was typo/mistake that I just fixed, my style sheets are in _sass.

Works great on on my new ras pi 4, 10 simple steps, same steps I used for Windows and now included on the website (near the bottom).

So this must be a bug in the “officially unsupported” Jekyll for Windows and GitHub pages, and that disclaimer is right there, right upfront in the GitHub doc. :slight_smile:

Just seems like such a simple thing that someone other than me has run into.