Wryth's avatar
Level 1

expected "indent", got "eos" (Stylus)

Hey,

I'm currently using Stylus as a CSS preprocessor.

In the webpack.mix.js I used what was written in the doc:

mix.js('resources/js/app.js', 'public/js')
   .stylus('resources/stylus/app.styl', 'public/css');

And i got an app.styl stylus file which is importing an other stylus file called var.styl:

@import 'var'

But then in the watcher command prompt it display me this error:

ERROR in ./resources/stylus/app.styl
Module build failed: ModuleBuildError: Module build failed: ParseError: C:\Users\Lucas\Desktop\laravel\resources\stylus\var.styl:1:42
   1| test #fff
-----------------------------------------------^

expected "indent", got "eos"

Everything works fine if the stylus code is located in the app.styl file but I got this error for any other file i'm importing.

Is there a way to solve this problem ?

0 likes
5 replies
bobbybouwmann's avatar

Mmhh this can be anything! Did you check for double opening brackets { or closing brackets }?

It also happend to me once when I had this in my code

// Notice the double #
white ##fff 
Wryth's avatar
Level 1

Well, I do not have any double # or any tab or unwanted whitespace, I just started a new empty stylus file with any else than "blank #fff" and just yet it display the same error. So it happen not only on import.

cmdobueno's avatar

I am not familiar with stylus, but maybe you have the wrong line endings configured in your editor? Just a thought...

Wryth's avatar
Wryth
OP
Best Answer
Level 1

I just understood my mistake and it's a stupid one

I though stylus var could be assigned without using the = symbol but in fact that's not possible

So I just solved it by correcting my error:

blank = #fff

thanks for all of your reply :)

Please or to participate in this conversation.