Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

Two consecutive @import statements prevent both files from being imported #264

Closed jdiez17 closed 10 years ago

jdiez17 commented 10 years ago

Hi, I run into a very strange issue with two consecutive imports, like so:

@import 'media-player.scss'
@import 'view-responsive.scss'

It complains about both files being missing:

2014-01-11 18:13:16,807 - scss - WARNING - File to import not found or unreadable: 'view-responsive.scss'
@import 'media-players.scss' (/home/jdiez/MediaCrush/styles/view.scss:1)
Load paths:
    /home/jdiez/MediaCrush/styles
    /home/jdiez/MediaCrush
2014-01-11 18:13:16,841 - scss - WARNING - File to import not found or unreadable: 'view-responsive.scss'
@import 'media-players.scss' (/home/jdiez/MediaCrush/styles/view.scss:1)
Load paths:
    /home/jdiez/MediaCrush/styles
    /home/jdiez/MediaCrush
2014-01-11 18:13:17,109 - scss - WARNING - File to import not found or unreadable: 'view-responsive.scss'
@import 'media-players.scss' (<string "@import 'stylesheet.scss'\n\n.media-wrapper {\n    ri"...>:0)
Load paths:
    /home/jdiez/MediaCrush
    /home/jdiez/MediaCrush/styles
2014-01-11 18:13:20,384 - scss - WARNING - File to import not found or unreadable: 'view-responsive.scss'
@import 'media-players.scss' (/home/jdiez/MediaCrush/styles/view.scss:1)
Load paths:
    /home/jdiez/MediaCrush/styles
    /home/jdiez/MediaCrush
2014-01-11 18:13:20,413 - scss - WARNING - File to import not found or unreadable: 'view-responsive.scss'
@import 'media-players.scss' (/home/jdiez/MediaCrush/styles/view.scss:1)
Load paths:
    /home/jdiez/MediaCrush/styles

At first I thought it was a circular import loop because it would seem from the error messages that the files are trying to include each other, but I was able to work around this issue by adding a dummy element between the two imports: https://github.com/MediaCrush/MediaCrush/commit/6526eeb22a62eb8435ac867d784f1b241dd06eed

pib commented 10 years ago

It works if you put semicolons at the end of your import lines, or at least the first one. I'd say probably might as well put them on both, though.

eevee commented 10 years ago

This is definitely bogus syntax :) Should definitely have a more coherent error message, though.

eevee commented 10 years ago

This now produces an actual syntax error, as it should.