suspenders
suspenders copied to clipboard
Broken normalize import when yarn isn't installed
Ran into this when it seemed like suspenders created a new project without any errors:
File to import not found or unreadable: normalize.css/normalize.
I had to track down how normalize was installed by digging into the source code. Seems like a preliminary check for a yarn installation might be necessary.
Anyone ever find a fix for this? i'm having the same issue.
I just tried to use Suspenders and I have to admit to disappointment. If it is supposed to help people launch a new app quickly with lots of bells and whistles attached it simply doesn't work. First there are a load of "hidden" ENV variables to add in both staging and production, which are then incompatible with SENDGRID ENV variables supplied by Heroku. After that it simply falls over with this normalize issue above, so now I'm giving up and going back to the old "rails new" instead. A pity. It shows promise but it simply doesn't work out of the box and after three hours of hacking around I'm giving up.
Anyone ever find a fix for this? i'm having the same issue.
If you want to use yarn
to retrieve assets, you have to install it first from https://yarnpkg.com/en/docs/install. Otherwise, you can remove the @import 'normalize.css/normalize'
line from application.css
I think it could be a note in the readme about yarn
dependency 🤔
I just tried to use Suspenders and I have to admit to disappointment. If it is supposed to help people launch a new app quickly with lots of bells and whistles attached it simply doesn't work. First there are a load of "hidden" ENV variables to add in both staging and production, which are then incompatible with SENDGRID ENV variables supplied by Heroku. After that it simply falls over with this normalize issue above, so now I'm giving up and going back to the old "rails new" instead. A pity. It shows promise but it simply doesn't work out of the box and after three hours of hacking around I'm giving up.
Feel free to contribute :)
I think a note in the readme might suffice. I was thinking we could also add run "yarn --version"
to check for a yarn installation in one of the generators and display installation instructions if nothing is found.
@anhari @delphaber - Suspenders worked locally for me, but I hit this issue when deploying to Heroku.
To fix the issue on Heroku, I had to add the code below to my Gemfile:
gem "webpacker", require: false
I had to add nodejs as a buildpack BEFORE the ruby one on heroku. No need for webpacker
🤔 .
Take a look at https://github.com/thoughtbot/suspenders/issues/930
Suspenders is now on Rails 6, which uses yarn and webpacker by default. If you don't have yarn installed it will print:
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
I just saw this error again when trying to deploy a newly created application to Heroku. I am using yarn, but normalize still isn't available. I think this is because the suspenders:stylesheet_base
generator does not run by default when the application is created. We should move the normalize import into that generator.
Actually, this was the same problem. Something was up with my yarn install. It was still confusing, so I will leave this issue open. I wonder if we can fail right away with a more obvious message if yarn is not installed?