Undefined variable error but variable is indeed defined
See original GitHub issue//_variable.scss
$blue-base: #66ccff;
$blue-dark: darken($blue-base, 10%);
$blue: $blue-base;
$blue-light: lighten($blue-base, 10%);
$blue-lighter: lighten($blue-base, 20%);
$blue-lightest: lighten($blue-base, 25%);
$link-color: $blue-dark;
$link-some-active-color: $blue;
// _global.scss
a {
color: $link-color;
text-decoration: none;
&:hover, &:active, &:focus {
color: $link-some-active-color;
}
}
Error:
events.js:141
throw er; // Unhandled 'error' event
^
Error: src/sass/_global.scss
Error: Undefined variable: "$link-some-active-color".
on line 20 of src/sass/_global.scss
>> color: $link-some-active-color;
---------------^
I am using Gulp.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Undefined variable error while the variable was indeed ...
My question is basically the same as describe here (see link) , but the answer did not explain things well and did not...
Read more >How do I fix error "undefined variable" in php, when I have ...
I'm trying to define a class of Sphere, which can calculate various aspects of a sphere given its radius. However, I'm getting an...
Read more >Undefined variable error in scss while compiling using sass ...
I'm new to the sass ecosystem and I'm facing a really annoying issue. ... Undefined variable error but variable is indeed defined.
Read more >When saving a nav-menu I get error messages about ...
Hi, Whan I save a nav-menu (on wp-admin/nav-menus.php), I get error messages: Notice: Undefined variable: youtube_details in…
Read more >7 Tips to Handle undefined in JavaScript - Dmitri Pavlutin
Undefined value primitive value is used when a variable has not been assigned a value. The standard clearly defines that you will receive ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@manix I faced the same issue with Sass, in my case the error was because I included the variables file after the other file where I used them, you could try doing this, reorder files import, make the variables file at the top.
@guoyunhe can you elaborate?