0

harpjs won't compile stylus *.styl stylesheets when using harp server, harp server.

This is the error I get when I try to use main.styl as a stylesheet, linking it with main.css within my index.jade document (Jade is working perfectly, with no errors, I also tried using html documents instead of jade, but the issue was not resolved unfortunately.)

enter image description here

However, as soon as I add an empty main.css file in my file structure, the error disappears, although, no styles are applied (it's an empty document, what should I expect though right?)

So, I was wondering if anyone has come across this error, or abnormality before, and if so, how they fixed it,

Things I've Tried

  • re-installing stylus (npm install -g stylus)
  • re-installing harp (npm install -g harp)
  • re-installing jade (npm install -g pug)
  • re-installing pug (npm install -g pug)
  • trying a different device
  • trying a different os; (Linux instead of OS X)

All of which, unfortunately, didn't fix the issue.

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • works with SASS or Less? –  Oct 24 '16 at 13:06
  • Less works as expected, just not stylus unfortunately. (I tested this just by running `harp init myProj`. –  Oct 24 '16 at 21:35
  • Sorry but I can't reproduce your error. Works fine for me. I suppose you don't have stylus sytax errors, isn't it? –  Oct 25 '16 at 05:07
  • That's ok, and no, zero syntax errors in my stylus code, I tried compiling it directly and it works, just really want it to work with harp! –  Oct 25 '16 at 05:25
  • I reproduce the issue upgrading nodejs to version 6, before I had 4.6.0 version and worked fine. Which version of node you have? –  Oct 26 '16 at 07:54
  • I have version 6.8.0 –  Oct 26 '16 at 08:02

2 Answers2

1

I have a solution. Terraform is the pre-processor engine of harp and uses stylus 0.53.0, I update to stylus 0.54.5 (the lastest version) and now works.

I search terraform in harp directory: harp\node_modules\terraform\node_modules and update stylus: npm install stylus@0.54.5 --save

  • Why downvote? Is a valid solution for the problem, I spend much time searching a solution and make a lot of test. Something is wrong in my answer? –  Oct 26 '16 at 10:11
0

I didn't really fix it entirely, however, I did find a workaround.

As I use sublime text, I found a really nice stylus plugin, which allow for compilation on save, a really cool feature. So, basically, I'm just using harp as a jade preprocessor now which is ok, but hey, it sort of works now.