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

Got range error #1712

Closed
yusukegoto opened this issue Jun 6, 2022 · 8 comments · Fixed by #1713
Closed

Got range error #1712

yusukegoto opened this issue Jun 6, 2022 · 8 comments · Fixed by #1713
Assignees
Labels

Comments

@yusukegoto
Copy link

Hello.

When I updated the dart-sass from 1.52.1 to 1.52.2, I got the error below.
Error: RangeError: Invalid value: Not in inclusive range 0..203: -1

Could you have a look? Thanks!

This is the part of ERROR Summary.

  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: SassCompiler
  - originalErrorMessage: Error: RangeError: Invalid value: Not in inclusive range 0..203: -1
  - stack: Error: RangeError: Invalid value: Not in inclusive range 0..203: -1
    at Object.wrapException (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:1234:17)
    at Interceptor.lastIndexOf$2 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:25924:17)
    at _SerializeVisitor0._serialize0$_isTrailingComment$2 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:91405:50)
    at _SerializeVisitor0._serialize0$_visitChildren$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:91353:19)
    at _SerializeVisitor0.visitCssStyleRule$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:90622:13)
    at ModifiableCssStyleRule0.accept$1$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:92659:22)
    at ModifiableCssStyleRule0.accept$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:92662:19)
    at _SerializeVisitor0.visitCssStylesheet$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:90536:19)
    at ModifiableCssStylesheet0.accept$1$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:92709:22)
    at ModifiableCssStylesheet0.accept$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:92712:19)
    at Object.serialize0 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:21669:12)
    at /Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:15367:35
    at _wrapJsFunctionForAsync_closure.$protected (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:3726:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:27983:12)
    at _awaitOnObject_closure.call$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:27971:32)
    at _RootZone.runUnary$2$2 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:29638:18)
    at _Future__propagateToListeners_handleValueCallback.call$0 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:28452:51)
    at Object._Future__propagateToListeners (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:3897:93)
    at _Future._completeWithValue$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:28311:9)
    at _AsyncAwaitCompleter.complete$1 (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:27958:14)
    at Object._asyncReturn (/Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:3698:17)
    at /Users/yusukegoto/src/immo/immo-platform/node_modules/sass/sass.dart.js:72844:24

Edited log file
dart-sass-range-error.log

@Goodwine
Copy link
Member

Goodwine commented Jun 6, 2022

I got a repro case too, I'll look further into this

@Goodwine
Copy link
Member

Goodwine commented Jun 7, 2022

Min repro case:

// _a.scss
/* comment */
// _b.scss
@forward 'a'
// _c.scss
@forward 'a'
// input.scss
@import 'b';
@import 'c';

It seems to be because the node /* comment */ appears twice in the output file, technically being the same node contained in the same file (implementation detail)

@Goodwine
Copy link
Member

Goodwine commented Jun 7, 2022

(note: it also happens with @import instead of @forward, that just happens to be the case that I found)

@D-Thrane
Copy link

D-Thrane commented Jun 8, 2022

Without updating any packages We are now getting this error when running "next run dev". Is it the same problem?

error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[9].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[9].use[2]!./node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js??ruleSet[1].rules[3].oneOf[9].use[3]!./node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[3].oneOf[9].use[4]!./src/styles/styles.scss
SassError: RangeError: Invalid value: Not in inclusive range 0..294: -1

@Goodwine
Copy link
Member

Goodwine commented Jun 8, 2022

Looks like it, hopefully this will be merged by tomorrow evening Pacific time :)

@JensMou
Copy link

JensMou commented Jun 8, 2022

Looks like it, hopefully this will be merged by tomorrow evening Pacific time :)

And this will fix this error in running next locally (it builds fine) with the sass module?

Without updating any packages We are now getting this error when running "next run dev". It it the same problem?

error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[9].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[9].use[2]!./node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js??ruleSet[1].rules[3].oneOf[9].use[3]!./node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[3].oneOf[9].use[4]!./src/styles/styles.scss SassError: RangeError: Invalid value: Not in inclusive range 0..294: -1

@Goodwine
Copy link
Member

Goodwine commented Jun 8, 2022

I'm pretty sure it will, there can be other corner cases but for your error log in particular it should

@JensMou
Copy link

JensMou commented Jun 9, 2022

I'm pretty sure it will, there can be other corner cases but for your error log in particular it should

This worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants