-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Undefined variable errors only in watch mode. #2560
Comments
Finally, the problem is solved by adding '_' prefix to the partials, like changing sass2.scss to _sass2.scss. |
I need to reopen this issue because it is not an issue in dart-sass cli, is this by design or a bug? Why does this only happen in watch mode? |
Having the same problem. Would appreciate it if node-sass worked the same in non-watch and watch mode. |
convert all file names with beginning "_" example: |
This is by design. When a file is not prefixed with an |
main.scss:
test1.scss:
$w: white
test2.scss
.c{color: $w}
Run in win10 cmd:
node-sass main.scss main.css
No error, generated content:
.p {color: white; }
But if I run the watcher:
node-sass --watch main.scss main.css
Then make changes to test2.scss and save, error:
npm -v
): 6.4.1node -v
): v8.12.0node -p process.versions
):{ http_parser: '2.8.0',
node: '8.12.0',
v8: '6.2.414.66',
uv: '1.19.2',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
nghttp2: '1.32.0',
napi: '3',
openssl: '1.0.2p',
icu: '60.1',
unicode: '10.0',
cldr: '32.0',
tz: '2017c' }
node -p process.platform
): win32node -p process.arch
):x64node -p "require('node-sass').info"
): Cannot find module 'node-sass'npm ls node-sass
): C:\Users\xxx\Desktop`-- (empty)ndoe-sass -v
):node-sass 4.10.0 (Wrapper) [JavaScript]
libsass 3.5.4 (Sass Compiler) [C/C++]
I know if I add @import "test1" to "test2.scss" it would not complain, but I wonder why this error only happens in watch mode?
The text was updated successfully, but these errors were encountered: