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

Weird import bug with --resolve-url? Not getting any CSS output #2119

Closed
thybzi opened this Issue Feb 22, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@thybzi

thybzi commented Feb 22, 2016

I have the following file structure (minimal set to reproduce bug):

styl
|-- _base
|   `-- test
|       |-- index.styl
|       |-- main.styl
|       `-- vars.styl
|-- mobile
|   `-- test
|       |-- index.styl
|       |-- main.styl
|       `-- vars.styl
`-- mobile.styl

And the files content:

_base/test/index.styl and mobile/test/index.styl:

@import 'vars'
@import 'main'

_base/test/main.styl and _base/test/vars.styl:
no matter, may be even empty.

mobile/test/test.styl

@import '../../_base/test/main'
.test
  color: red

mobile/test/vars.styl

@import '../../_base/test/vars'

mobile.styl

@import 'mobile/test'

All the @import constructs may be changed to @require, that doesn't change the thing. Which is:

When I compile mobile.styl to mobile.css with --resolve-url flag, the output is empty (no error, but just nothing is output)

Now, if I remove import line from mobile/test/vars.styl (which imports _base/test/vars.styl), I can see my output in CSS file!

And if I change import lines order in mobile/test/index.styl (putting main first and vars second), I also can see my output in CSS file!

.test {
  color: #f00;
}

What is the trick? Why auxiliary import prevents my .styl file to output any CSS? Looks very weird.

@Panya

This comment has been minimized.

Show comment
Hide comment
@Panya

Panya Feb 22, 2016

Member

I can't reproduce it with Stylus 0.53.0 (the latest version, CLI). Maybe you're using some flags or plugins?

Member

Panya commented Feb 22, 2016

I can't reproduce it with Stylus 0.53.0 (the latest version, CLI). Maybe you're using some flags or plugins?

@thybzi

This comment has been minimized.

Show comment
Hide comment
@thybzi

thybzi Feb 22, 2016

Whoa, completely right idea! Yes, I've checked the flags, and it ONLY reproduces with --resolve-url!
(Also using CLI Stylus 0.53.0)

thybzi commented Feb 22, 2016

Whoa, completely right idea! Yes, I've checked the flags, and it ONLY reproduces with --resolve-url!
(Also using CLI Stylus 0.53.0)

@thybzi thybzi changed the title from Weird import bug? Not getting any CSS output to Weird import bug with --resolve-url? Not getting any CSS output Feb 22, 2016

@thybzi

This comment has been minimized.

Show comment
Hide comment
@thybzi

thybzi Feb 22, 2016

I've changed the issue title and the head post to mention --resolve-url

thybzi commented Feb 22, 2016

I've changed the issue title and the head post to mention --resolve-url

@Panya

This comment has been minimized.

Show comment
Hide comment
@Panya

Panya Feb 22, 2016

Member

Yep, it's known issue, try to use --resolve-url-nocheck instead, it should work the same way but without this unexpected behavior.

Member

Panya commented Feb 22, 2016

Yep, it's known issue, try to use --resolve-url-nocheck instead, it should work the same way but without this unexpected behavior.

@thybzi

This comment has been minimized.

Show comment
Hide comment
@thybzi

thybzi Feb 22, 2016

Is there any duplicate issue about that, which I should watch?
Or this --resolve-url-nocheck is not temporary but the final solution?

thybzi commented Feb 22, 2016

Is there any duplicate issue about that, which I should watch?
Or this --resolve-url-nocheck is not temporary but the final solution?

@Panya

This comment has been minimized.

Show comment
Hide comment
@Panya

Panya Feb 22, 2016

Member

It will be the default behavior for --resolve-url in 1.0, so yep, it's final.

Member

Panya commented Feb 22, 2016

It will be the default behavior for --resolve-url in 1.0, so yep, it's final.

@Panya Panya closed this Feb 22, 2016

@thybzi

This comment has been minimized.

Show comment
Hide comment
@thybzi

thybzi Feb 22, 2016

Thank you for the help!
And I confirm that using --resolve-url-nocheck fixes my situation.

thybzi commented Feb 22, 2016

Thank you for the help!
And I confirm that using --resolve-url-nocheck fixes my situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment