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

Notice: Trying to get property 'sourceIndex' of non-object in vendor/scssphp/scssphp/src/Compiler.php on line 4481 #47

Closed
dac514 opened this issue Sep 18, 2019 · 2 comments

Comments

@dac514
Copy link

dac514 commented Sep 18, 2019

I'm doing dumb things with append, @import and an @each loop, I'm getting:

Notice: Trying to get property 'sourceIndex' of non-object in vendor/scssphp/scssphp/src/Compiler.php on line 4481

Notice: Undefined index: in vendor/scssphp/scssphp/src/Compiler.php on line 4481

Using v1.0.4

Help?

@dac514
Copy link
Author

dac514 commented Sep 18, 2019

Here's the SCSS that seems to trigger this error, not sure how helpful this is out of context:

Seems to happen when $shapeshifter-font-1 and $shapeshifter-font-2 are identical.

$shapeshifter-fonts: ();

@if variable-exists(shapeshifter-font-1) {
  $shapeshifter-fonts: append($shapeshifter-fonts, $shapeshifter-font-1, ',' )
}

@if variable-exists(shapeshifter-font-2) {
  $shapeshifter-fonts: append($shapeshifter-fonts, $shapeshifter-font-2, ',' )
}

@each $font in $shapeshifter-fonts {
  @if unquote($font) == 'Cormorant Garamond' {
    @import 'CormorantGaramondFont';
  } @else if unquote($font) == 'Noto serif' {
    @import 'NotoSerifFont';
  } @else if unquote($font) == 'Spectral' {
    @import 'SpectralFont';
  } @else if unquote($font) == 'Alegreya' {
    @import 'AlegreyaSansSCFont';
  } @else if unquote($font) == 'Crimson Text' {
    @import 'CrimsonTextFont';
  } @else if unquote($font) == 'Roboto' {
    @import 'RobotoFont';
  } @else if unquote($font) == 'Open Sans' {
    @import 'OpenSansFont';
  } @else if unquote($font) == 'Lato' {
    @import 'LatoFont';
  } @else if unquote($font) == 'Montserrat' {
    @import 'MontserratFont';
  } @else if unquote($font) == 'Raleway' {
    @import 'RalewayFont';
  } @else if unquote($font) == 'Noto Sans' {
    @import 'NotoSansFont';
  } @else if unquote($font) == 'Rubik' {
    @import 'RubikFont';
  } @else if unquote($font) == 'Barlow' {
    @import 'BarlowFont';
  } @else if unquote($font) == 'Libre Franklin' {
    @import 'LibreFranklinFont';
  } @else if unquote($font) == 'K2D' {
    @import 'K2DFont';
  }
}

@robocoder
Copy link
Member

You might also be missing a semi-colon on those append() lines.

dac514 added a commit to pressbooks/pressbooks that referenced this issue Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants