Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Cannot read property 'first' of null #252

Open
@scottlet

Description


  • Atom version: 1.45.0 x64
  • linter-sass-lint version: 1.9.0
  • Global sass-lint version (if used): none
  • Platform:
    • OSX
    • Windows
    • Linux
  • Expected behaviour: Linting
  • Actual behaviour / issue description:
    Linter fails to parse sass file.

This seems related to css variables. I've created a minimal test case that reproduces the error:

$foo-green: #1fecce;

.foo-green {
    --accent: #{$foo-green};
}

Gives the error:

linter-sass-lint TypeError: Cannot read property 'first' of null
    at /Users/scott/.atom/packages/linter-sass-lint/node_modules/sass-lint/lib/rules/property-sort-order.js:108
    at Node.forEach (/Users/scott/.atom/packages/linter-sass-lint/node_modules/gonzales-pe-sl/lib/gonzales.js:179)
    at Node.<anonymous> (/Users/scott/.atom/packages/linter-sass-lint/node_modules/sass-lint/lib/rules/property-sort-order.js:106)
    at /Users/scott/.atom/packages/linter-sass-lint/node_modules/gonzales-pe-sl/lib/gonzales.js:308
    at Node.traverse (/Users/scott/.atom/packages/linter-sass-lint/node_modules/gonzales-pe-sl/lib/gonzales.js:288)
    at Node.traverse (/Users/scott/.atom/packages/linter-sass-lint/node_modules/gonzales-pe-sl/lib/gonzales.js:293)
    at Node.traverse (/Users/scott/.atom/packages/linter-sass-lint/node_modules/gonzales-pe-sl/lib/gonzales.js:293)
    at Node.traverseByType (/Users/scott/.atom/packages/linter-sass-lint/node_modules/gonzales-pe-sl/lib/gonzales.js:307)
    at Object.detect (/Users/scott/.atom/packages/linter-sass-lint/node_modules/sass-lint/lib/rules/property-sort-order.js:99)
    at /Users/scott/.atom/packages/linter-sass-lint/node_modules/sass-lint/index.js:134
    at Array.forEach (<anonymous>)
    at Function.sassLint.lintText (/Users/scott/.atom/packages/linter-sass-lint/node_modules/sass-lint/index.js:133)
    at Object.provider.lint (main.coffee? [sm]:140)
    at linter-registry.js? [sm]:101
    at new Promise (<anonymous>)
    at _loop (linter-registry.js? [sm]:99)
    at LinterRegistry.<anonymous> (linter-registry.js? [sm]:84)
    at Generator.next (<anonymous>)
    at LinterRegistry.<anonymous> (linter-registry.js? [sm]:169)
    at Generator.next (<anonymous>)
    at step (/Users/scott/.atom/packages/linter/lib/linter-registry.js:9)
    at /Users/scott/.atom/packages/linter/lib/linter-registry.js:9
    at new Promise (<anonymous>)
    at LinterRegistry.<anonymous> (/Users/scott/.atom/packages/linter/lib/linter-registry.js:9)
    at main.js? [sm]:89
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11)
    at EditorLinter.debouncedLint.leading (editor-linter.js? [sm]:8)
    at invokeFunc (/Users/scott/.atom/packages/linter/node_modules/lodash/debounce.js:95)
    at leadingEdge (/Users/scott/.atom/packages/linter/node_modules/lodash/debounce.js:105)
    at debounced (/Users/scott/.atom/packages/linter/node_modules/lodash/debounce.js:172)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11)
    at TextBuffer.saveTo (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions