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

Unexpected exception:RangeError (index): Index out of range: index should be less than 1: 1 #18

Closed
FDiskas opened this issue Nov 1, 2016 · 9 comments

Comments

@FDiskas
Copy link

FDiskas commented Nov 1, 2016

Im using: 1.0.0-alpha.1 compiled with dart2js 1.20.1
I got the following error:

Unexpected exception:RangeError (index): Index out of range: index should be less than 1: 1
node_modules/dart-sass/sass.dart.js 4154:17   wrapException
node_modules/dart-sass/sass.dart.js 4104:15   ioore
node_modules/dart-sass/sass.dart.js 17688:22  Environment.getFunction$1
node_modules/dart-sass/sass.dart.js 27465:66  _PerformVisitor.visitFunctionExpression$1
node_modules/dart-sass/sass.dart.js 16014:24  FunctionExpression.accept$1
node_modules/dart-sass/sass.dart.js 27370:75  _PerformVisitor.visitVariableDeclaration$1
node_modules/dart-sass/sass.dart.js 16637:24  VariableDeclaration.accept$1
node_modules/dart-sass/sass.dart.js 31349:41  J.accept$1$x
node_modules/dart-sass/sass.dart.js 28126:13  _PerformVisitor__visitDynamicImport__closure.call$0
node_modules/dart-sass/sass.dart.js 27703:27  _PerformVisitor._withEnvironment$2

My environment is:
package.json

{
  "name": "untitled",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "dart-sass ./src/main.scss dist/main.css  > ./dist/main.css"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "bootstrap-sass": "^3.3.7"
  },
  "devDependencies": {
    "dart-sass": "^1.0.0-alpha.1"
  }
}

src/main.scss

@import "../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap";
@FDiskas
Copy link
Author

FDiskas commented Nov 1, 2016

📣 Probably I want to mutch. But its good point to test this :)

@nex3 nex3 added the bug label Nov 1, 2016
@nex3
Copy link
Contributor

nex3 commented Nov 1, 2016

This looks like something @kaelig was seeing, but we couldn't figure out what was causing it. Unfortunately, knowing that the culprit is somewhere in all of bootstrap doesn't narrow it down much. Let me know if you can find a more isolated chunk of stylesheet that reproduces this.

@nex3 nex3 added the needs info label Nov 1, 2016
@FDiskas
Copy link
Author

FDiskas commented Nov 1, 2016

npm install gnomon

p.s. about benchmark. dart-sass with error returns the following

npm run dev | gnomon

returns Total 0.0117s

And the node-sass - with successfully builded whole bootstrap
returns: Total 0.0132s

@FDiskas
Copy link
Author

FDiskas commented Nov 1, 2016

And the error is caused by this line in bootstrap settings scss file

$gray-darker:            lighten($gray-base, 13.5%) !default; // #222

Same error and for darken(#428bca, 6.5%);

@FDiskas
Copy link
Author

FDiskas commented Nov 1, 2016

And all other functions like ceil, floor, rgba and some logick like
(720px + $grid-gutter-width)
causing this errors

@nshahan
Copy link
Contributor

nshahan commented Nov 1, 2016

I think I am getting a similar issue. I just created a simple test to reproduce the issue.

#20

@nex3
Copy link
Contributor

nex3 commented Nov 1, 2016

Fixed by e0fd5ea.

@praharshbhatt
Copy link

praharshbhatt commented Dec 4, 2019

can anyone help with the same issue here ?

@nshahan
Copy link
Contributor

nshahan commented Dec 4, 2019

@praharshbhatt Since you are getting this error from another project entirely the symptom (error message) is the same but the root cause is completely different. Somewhere in the code you are using there is an attempt to perform an index operation with a value that is outside the range of the collection being indexed into.

nex3 pushed a commit that referenced this issue May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants