Materialize: Uncaught Error: Scss compiler error: Undefined variable: "$medium-and-down".

Created on 10 Nov 2016  路  22Comments  路  Source: Dogfalo/materialize

Just got this after updating Meteor to 1.4.2.1 and Materialize to 0.97.8.

bug

Most helpful comment

@MuyBien Clone the materialize repo into the /packages folder inside your project folder.
Via shell:

cd /path/to/YOURPROJECTFOLDER
mkdir packages
cd packages
git clone https://github.com/Dogfalo/materialize.git

222222

Then open this file inside the materialize folder in your packages folder.
bildschirmfoto 2016-11-29 um 11 06 08
and change

  name: 'materialize:materialize',  // http://atmospherejs.com/materialize/materialize

to something like this:

  name: 'tomscholz:materialize',  // http://atmospherejs.com/materialize/materialize

Then run:

meteor remove materialize:materialize
meteor add tomscholz:materialize

Than follow the instructions here https://github.com/Dogfalo/materialize/issues/3905#issuecomment-261996137

et voil脿
Also check this out --> https://github.com/Dogfalo/materialize/pull/3924

UPDATE

Due to some badge refactorisation blalala you need to add the _badge.scss to your packages.js:
Like here https://github.com/Dogfalo/materialize/pull/4000/commits/b8f3aeeda1d905546c00772af0f33ff39094f951

All 22 comments

+1

@Dogfalo I can reproduce. This is NOT an issue with the Meteor update.

Seems like this is an issue with a Materialize SCSS definition in 0.97.8. Downgrading to 0.97.7 fixes this error.

Anyone upgrading meteor versions is also prompted for package updates, such as materialize:materialize.

How to downgrade? Mine will auto install latest materialize:materialize 0.97.8

Even if specify meteor add materialize:[email protected]

@Phixiys
You have to run

meteor add materialize:materialize@=0.97.7

You can read more about it here
https://atmospherejs.com/i/installing

@Dogfalo Yeah, searched stackoverflow and found it. Thank's though.
:-)

Meh, the easiest way is to manually edit your .meteor/versions file :stuck_out_tongue: Then meteor will install the proper Materialize package automatically without updating. This can even be done running hot.

Can't seem to reproduce locally. I fresh installed Node, NPM, and Meteor.

I did run into some issues when trying to install the Materialize package fresh. But after I installed the fourseven:scss package first, installing Materialize went smoothly.

I encountered the same error $medium-and-down... and downgraded materializecss to version 0.97.7.
But now I got another issue: Failed to decode downloaded font: ...Roboto...
As seen here -> #2217

submitted a pull request to correct this #3924

@acburst I did the same as you, and I definitely reproduce the same error.

@charlesdagenais can you tell us a bit more about the fix?

@keyscores Looks like the error happen when sass try to compile sass/style.scss . The compiler can't resolve any variable, because they're not imported. style.scss is only used for documentation website style. Renaming it to _style.scss and correcting the import statement in ghpages-materialize prevent it from been compiled to css

capture d ecran 2016-11-21 a 11 50 31
capture d ecran 2016-11-21 a 11 50 49

@charlesdagenais @acburst
With the fix applied I get:

=> Errors prevented startup:                  

   While processing files with fourseven:scss (for target web.browser):
   /client/css/index.scss: Scss compiler error: Undefined variable:
   "$small-and-down".

   /client/css/login.scss: Scss compiler error: ".forgot .login-row" failed to
   @extend ".row".
   The selector ".row" was not found.
   Use "@extend .row !optional" if the extend should be able to fail.

   /client/css/map.scss: Scss compiler error: Undefined variable:
   "$small-and-down".
=> Your application has errors. Waiting for file change.

@tomscholz you forgot to rename /sass/style.scss file to sass/_style.scss

@charlesdagenais Thats true, but now I changed the name, it didn't change anything :/ Even when I delete _style.scss and ghpages-materialize.scss I get the same error

@tomscholz Just tried your fork of the materialize package in my app and it's working perfectly fine. looks like the problem is in your index.scss and login.scss and map.scss

@tomscholz if you want to use variables in your custom scss files, you need to import them from the materialize package

Hi everybody!
I have the same problem and I cannot find the style.scss file in my project directory.
Where are those files going from the .meteor directory ?

Thanks gor your help

@MuyBien Clone the materialize repo into the /packages folder inside your project folder.
Via shell:

cd /path/to/YOURPROJECTFOLDER
mkdir packages
cd packages
git clone https://github.com/Dogfalo/materialize.git

222222

Then open this file inside the materialize folder in your packages folder.
bildschirmfoto 2016-11-29 um 11 06 08
and change

  name: 'materialize:materialize',  // http://atmospherejs.com/materialize/materialize

to something like this:

  name: 'tomscholz:materialize',  // http://atmospherejs.com/materialize/materialize

Then run:

meteor remove materialize:materialize
meteor add tomscholz:materialize

Than follow the instructions here https://github.com/Dogfalo/materialize/issues/3905#issuecomment-261996137

et voil脿
Also check this out --> https://github.com/Dogfalo/materialize/pull/3924

UPDATE

Due to some badge refactorisation blalala you need to add the _badge.scss to your packages.js:
Like here https://github.com/Dogfalo/materialize/pull/4000/commits/b8f3aeeda1d905546c00772af0f33ff39094f951

Huuuuuuuuuuuu OK!!!
Thanks ! And when your PR will be accepted I can run:

meteor remove tomscholz:materialize
meteor add materialize:materialize

@MuyBien Yes ;D. Totally. You got it

Both PR have been merged, will be closing this issue for now unless further issues pop up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Robouste picture Robouste  路  3Comments

PhillippOhlandt picture PhillippOhlandt  路  3Comments

serkandurusoy picture serkandurusoy  路  3Comments

alexknipfer picture alexknipfer  路  3Comments

djensen47 picture djensen47  路  3Comments