PeterDev
PeterDev

Reputation: 141

How to fix "Undefined Variable" in node-sass?

I think that there is a bug with node-sass...

I've: - app.scss - variables.scss - style.scss

app.scss

@import 'variables';
@import 'style';

variables.scss

$green: #38c172;

style.scss

button{
    background-color: $green;
    }

It works fine, because in my file app.css I have:

button{
    background-color: #38c172;
    }

But I have always this error... why!?? I hate this!

error

Upvotes: 0

Views: 1793

Answers (2)

PeterDev
PeterDev

Reputation: 141

Ok I've fixed that! All the files must be renamed with an "_" to the beginning exept for app.scss

Upvotes: 2

AndreasDEV
AndreasDEV

Reputation: 55

It says that error is coming from line 42 in header.scss file.

border-bottom: 3px solid $green; is causing it. Check if you imported variables properly for header.scss file.

Upvotes: 2

Related Questions