Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Undefined variable errors only in watch mode. #2560

@hangoocn

Description

@hangoocn

main.scss:

@import "test1"
@import "test2"

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:

{
  "status": 1,
  "file": "C:/Users/xxx/Desktop/test2.scss",
  "line": 1,
  "column": 10,
  "message": "Undefined variable: \"$w\".",
  "formatted": "Error: Undefined variable: \"$w\".\n        on line 1 of Test2.scss\n>> .p{color:$w}\n   ---------^\n"
}

  • NPM version (npm -v): 6.4.1
  • Node version (node -v): v8.12.0
  • Node Process (node -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 Platform (node -p process.platform): win32
  • Node architecture (node -p process.arch):x64
  • node-sass version (node -p "require('node-sass').info"): Cannot find module 'node-sass'
  • npm node-sass versions (npm ls node-sass): C:\Users\xxx\Desktop`-- (empty)
  • node-sass version(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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions