Skip to content

throw error; ^ Bad state: No element #265

Open
@khofstadter

Description

@khofstadter

Hey.

I am with MacOS Venura, Node.js v22.11.0, jekyll 4.3.4, sass --version
1.81.0, sass-migrator --version 2.2.1 compiled with dart2js 3.5.4

When building a Jekyll site (with jekyll serve) on the computer, I've been getting this message for a while and thought I could best address it with the sass migrator:

Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

When trying

sass-migrator module --verbose '/Volumes/Doing/GitHub/biofeedbackartnetwork/_includes/main.scss

or

sass-migrator module --migrate-deps '/Volumes/Doing/GitHub/biofeedbackartnetwork/_includes/main.scss'

I get this error:

/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:5558
      throw error;
      ^

Bad state: No element
    at Object.wrapException (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:1810:43)
    at JavaScriptObject.get$first (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:15426:15)
    at NodeModulesImporter.canonicalize$1 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:43354:34)
    at ImportCache__canonicalize_closure.call$0 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:29756:28)
    at Object._rootRun (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4753:16)
    at StaticClosure.<anonymous> (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:44954:16)
    at _CustomZone.run$1$1 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:18762:39)
    at Object._runZoned (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4840:89)
    at Object.runZoned (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4837:16)
    at ImportCache._canonicalize$4 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:29714:18) {
  dartException: <ref *1> StateError {
    message: 'No element',
    '$thrownJsError': <ref *2> Bad state: No element
        at Object.wrapException (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:1810:43)
        at JavaScriptObject.get$first (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:15426:15)
        at NodeModulesImporter.canonicalize$1 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:43354:34)
        at ImportCache__canonicalize_closure.call$0 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:29756:28)
        at Object._rootRun (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4753:16)
        at StaticClosure.<anonymous> (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:44954:16)
        at _CustomZone.run$1$1 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:18762:39)
        at Object._runZoned (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4840:89)
        at Object.runZoned (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4837:16)
        at ImportCache._canonicalize$4 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:29714:18) {
      dartException: [Circular *1],
      '$cachedTrace': _StackTrace {
        _exception: [Circular *2],
        _trace: 'Bad state: No element\n' +
          '    at Object.wrapException (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:1810:43)\n' +
          '    at JavaScriptObject.get$first (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:15426:15)\n' +
          '    at NodeModulesImporter.canonicalize$1 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:43354:34)\n' +
          '    at ImportCache__canonicalize_closure.call$0 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:29756:28)\n' +
          '    at Object._rootRun (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4753:16)\n' +
          '    at StaticClosure.<anonymous> (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:44954:16)\n' +
          '    at _CustomZone.run$1$1 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:18762:39)\n' +
          '    at Object._runZoned (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4840:89)\n' +
          '    at Object.runZoned (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:4837:16)\n' +
          '    at ImportCache._canonicalize$4 (/usr/local/lib/node_modules/sass-migrator/sass-migrator.dart.js:29714:18)'
      }
    }
  }
}

Firstly, I am not really sure whether 'your-entrypoint.scss' is the 'main.scss' file in the '_includes' folder. Part of it looks like this:

@import '0-settings/variables';
@import '0-settings/color-scheme';
@import '0-settings/mixins';
@import '0-settings/helpers';


/* =======================
:: 1-Tools and Libs
======================= */
/* >>>>>>>>>>>>>> :: 1.1-Normalize <<<<<<<<<<<<<<< */
@import '1-tools/normalize';
/* >>>>>>>>>>>>>> :: 1.2-Reset <<<<<<<<<<<<<<< */
@import '1-tools/reset';
/* >>>>>>>>>>>>>> :: 1.3-Shared <<<<<<<<<<<<<<< */
@import '1-tools/shared';
/* >>>>>>>>>>>>>> :: 1.4-Syntax Highlighting <<<<<<<<<<<<<<< */
@import '1-tools/syntax-highlighting';
/* >>>>>>>>>>>>>> :: 1.5-Grid <<<<<<<<<<<<<<< */
@import '1-tools/grid';
/* >>>>>>>>>>>>>> :: 1.6-Animate <<<<<<<<<<<<<<< */
@import '1-tools/animate';

Thanks!

P.S. I have the same issue with another Jekyll website for which the files can be found here: https://github.com/khofstadter/enhancingaudiodescription.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions