suspenders icon indicating copy to clipboard operation
suspenders copied to clipboard

Broken normalize import when yarn isn't installed

Open anhari opened this issue 6 years ago • 10 comments

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.

anhari avatar Jun 23 '18 16:06 anhari

Anyone ever find a fix for this? i'm having the same issue.

ZASMan avatar Sep 06 '18 01:09 ZASMan

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.

swedishpotato avatar Sep 15 '18 20:09 swedishpotato

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 :)

delphaber avatar Sep 15 '18 21:09 delphaber

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 avatar Sep 26 '18 06:09 anhari

@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

ACPK avatar Oct 12 '18 01:10 ACPK

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

delphaber avatar Oct 17 '18 18:10 delphaber

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/

composerinteralia avatar Aug 23 '19 21:08 composerinteralia

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.

composerinteralia avatar Jun 24 '20 22:06 composerinteralia

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?

composerinteralia avatar Jun 25 '20 20:06 composerinteralia