Closed jbpyn closed 6 years ago
EDIT: Added the missing steps I explained in the other comments so it's easier to follow.
Hey! I too have it deployed on Netlify. To do so, follow these steps:
_config.yml
that says _assets/yarn
with node_modules
(assets -> sources).gitignore
that says /_assets/yarn
with /node_modules/
and delete the line with yarn.lock
/_assets/yarn
--modules-folder ./_assets/yarn
from bin/setup
's yarn install
command_assets/stylesheets/{light,dark}.scss
that say
@import "../yarn/fluidbox/src/css/_fluidbox.scss";
with
@import "../../node_modules/fluidbox/src/css/_fluidbox.scss";
bin/setup
and commit the changesjekyll build
_site/
Hope that helped!
Thanks so much for the pointers, I would never have known to remove the yarn.lock. Sadly I'm still failing with this. The first problem was Netlify only supports Ruby versions up to 2.4.2 - the .ruby-version file has 2.4.3 - As I say, I seriously fresh so I just rolled back the version in the .ruby-version file to 2.4.2 and hoped for the best. (I'm guessing this is probably silly now)
Anyway, It gets a lot further than before, but ends with this:
Assets: File to import not found or unreadable: ../yarn/fluidbox/src/css/_fluidbox.scss. Load paths: /opt/build/repo/_assets/icons /opt/build/repo/_assets/javascripts /opt/build/repo/_assets/stylesheets /opt/build/repo/_assets/yarn /opt/build/repo/assets/css /opt/build/repo/assets/fonts /opt/build/repo/assets/images /opt/build/repo/assets/videos /opt/build/repo/assets/audios /opt/build/repo/assets/components /opt/build/repo/assets/javascript /opt/build/repo/assets/video /opt/build/repo/assets/audio /opt/build/repo/assets/image /opt/build/repo/assets/img /opt/build/repo/assets/js /opt/build/repo/_assets/css /opt/build/repo/_assets/fonts /opt/build/repo/_assets/images /opt/build/repo/_assets/videos /opt/build/repo/_assets/audios /opt/build/repo/_assets/components /opt/build/repo/_assets/javascript /opt/build/repo/_assets/video /opt/build/repo/_assets/audio /opt/build/repo/_assets/image /opt/build/repo/_assets/img /opt/build/repo/_assets/js /opt/build/repo/css /opt/build/repo/fonts /opt/build/repo/images /opt/build/repo/videos /opt/build/repo/audios /opt/build/repo/components /opt/build/repo/javascript /opt/build/repo/audio /opt/build/repo/video /opt/build/repo/image /opt/build/repo/img /opt/build/repo/js /opt/build/repo/.jekyll-cache/assets/proxied Asset File light.scss:50 1:40:25 PM: Liquid Exception: Sass Error in /_layouts/post.html
Again, thanks for help. I'll keep muddling on.
You can change the Ruby Version to 2.3.3
.
But the error you're getting is due to something I forgot mentioning: the node_modules
dir will be in the root of the project, and not in _assets/.
There's no way of fixing this with the current yarn version, so we need to change the following as well:
_config.yml
that says _assets/yarn
with node_modules
(assets -> sources)I think that's the only other thing that needs to be changed!
I was getting same error again, so I tried also replacing the /_assets/yarn line in .gitignore
But, now I have this error Liquid Exception: no implicit conversion of nil into String in /_layouts/post.html
looking through the threads, I noticed a bunch of stuff about assets that I don't yet understand, so I'm guessing this has nothing to do with that file, and something to do with my setup?
Thanks again
You can remove that line and add in /node_modules/
to .gitignore
. You should also remove the _assets/yarn
dir, as it is useless. Also, swap the following from bin/setup
:
yarn install --modules-folder ./_assets/yarn
to
yarn install
This will make sure your local script also uses the /node_modules
dir, as Netlify.
Make sure to remove the caches and try again. Let me know if that helped!
Thanks for all your help with this, I had to leave it for a few days. Having tried it again, unfortunately I still couldn't get it to work. The problem occurs when it tries to import a file:
Assets: File to import not found or unreadable: ../yarn/fluidbox/src/css/_fluidbox.scss.
Looking through the comments I can see that others were having similar trouble using Bower. I have limited knowledge of how Bower has been replaced by Yarn, but I'm wondering if this has something to do with that change?
Again thanks
Found what was missing:
_assets/stylesheets/light.scss
_assets/stylesheets/dark.scss
change
@import "../yarn/fluidbox/src/css/_fluidbox.scss";
to
@import "../../node_modules/fluidbox/src/css/_fluidbox.scss";
You are one of the good ones, I cannot thank you enough. The site is live.
Awesome. Glad I could help!
Thanks @migueldemoura this is perfect!
@nhaglind Happy blogging!
Total noob here. Chalk is awesone, but I'm trying with out any to deploy it to Netlify. Can anyone point me in the right direction?