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

Order of @import-ing files changes randomly #13

Closed
bencergazda opened this issue Jul 31, 2017 · 1 comment
Closed

Order of @import-ing files changes randomly #13

bencergazda opened this issue Jul 31, 2017 · 1 comment

Comments

@bencergazda
Copy link
Contributor

bencergazda commented Jul 31, 2017

It looks like sometimes the order of @import-s are changing randomly:

D:\localhost\sass-extract-loader-master\examples\basics>npm start

> [email protected] start D:\Downloads\sass-extract-loader-master\examples\basics
> webpack 1>/dev/null && node dist/app.bundle


--- Style Varibles ---

global:
  $value:
	type:        SassString
	value:       OK
	sources:
	  - D:/localhost/sass-extract-loader-master/examples/basics/src/_style1.scss
	  - D:/localhost/sass-extract-loader-master/examples/basics/src/_style2.scss
	expressions:
	  - 'OK'
	  - 'NOT OK'



D:\localhost\sass-extract-loader-master\examples\basics>npm start

> [email protected] start D:\localhost\sass-extract-loader-master\examples\basics
> webpack 1>/dev/null && node dist/app.bundle


--- Style Varibles ---

global:
  $value:
	type:        SassString
	value:       NOT OK
	sources:
	  - D:/localhost/sass-extract-loader-master/examples/basics/src/_style2.scss
	  - D:/localhost/sass-extract-loader-master/examples/basics/src/_style1.scss
	expressions:
	  - 'NOT OK'
	  - 'OK'

The content of style.scss:

@import "style1";
@import "style2";

The content of _style1.scss:

$value: 'NOT OK';

The content of _style2.scss:

$value: 'OK';

It should return 'OK' as the value of $value, but as it can be seen, _style2.scss gets loaded before _style1.scss in the second run.

(I'm not sure, whether this is an issue with sass-extract or sass-extract-loader. I used sass-extract-loader's "Basic" example)

@jgranstrom
Copy link
Owner

@bencergazda there was an undefined behavior bug related to the order of the extracted variables that in my tests appeared about once every 20 run (but this can be completely random). This is now fixed in 0.5.3, thank you for finding and reporting it!

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