Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throw error; ^ Bad state: No element #265

Open
khofstadter opened this issue Nov 28, 2024 · 2 comments
Open

throw error; ^ Bad state: No element #265

khofstadter opened this issue Nov 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@khofstadter
Copy link

khofstadter commented Nov 28, 2024

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

@khofstadter
Copy link
Author

OK. My bad. Needed to be more specific with the paths:

% sass-migrator module --migrate-deps _includes/main.scss --load-path _sass

:)

@nex3
Copy link
Contributor

nex3 commented Dec 3, 2024

This shouldn't throw an internal error like this. @khofstadter, can you provide a reproduction? @jathak, can you try to track down what might cause this error?

@nex3 nex3 reopened this Dec 3, 2024
@nex3 nex3 added the bug Something isn't working label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants