sbt / sbt-stylus

sbt-web plugin for the stylus compiler
Other
2 stars 10 forks source link

stylus-shell.js: TypeError: Object #<Renderer> has no method 'deps' #5

Open helllamer opened 10 years ago

helllamer commented 10 years ago

Good day.

I've stumbled over runtime exception in stylus-shell.js.

NOTE: this issue reproduceable only in 5-10% developers workstations, but in 100% cases on this 5-10% workstations.

So, let's look at log:

$ sbt
[proj2] $ assets
[info] Stylus compiling on 1 source(s)
[error] [TypeError: Object #<Renderer> has no method 'deps']
[info] 
[success] Total time: 1 s, completed Jun 27, 2014 3:25:28 PM
[proj2] $ ^D

$ ls -R target/web/stylus
target/web/stylus/main/stylesheets:
main.css

As you can see, sbt-stylus printed error, printed "success" and successfully compiled .styl sources.

Let's look at stylus-shell.js:

  }).then(function(result) {
    return {
      source: input,
      result: {
          filesRead: [input].concat(result.style.deps()),
          filesWritten: [output]
      }
    };

As you can see, dangerous .deps() method is called here, not in stylus.

Problem goes away, if I replace .concat(result.style.deps()), with ,:

  }).then(function(result) {
    return {
      source: input,
      result: {
          filesRead: [input],
          filesWritten: [output]
      }
    };

This is quick and dirty solution, but it works. Hope, there will be better solution...

huntc commented 10 years ago

I'm not sure about this one. Given:

https://github.com/LearnBoost/stylus/blob/master/bin/stylus#L574

It appears as though calling .deps should be fine. How could it be otherwise?

mkurz commented 9 months ago

Pull requests are welcome!