zeke / harp-buildpack

A Heroku buildpack for static sites, powered by Node.js and Harp [Deprecated] See http://harpjs.com/docs/deployment/heroku)
http://harpjs.com/docs/deployment/heroku
35 stars 19 forks source link

node-sass error #12

Closed hafizio closed 9 years ago

hafizio commented 9 years ago

Hi there. I just did a small change to my application and it suddenly throwing this error. I wonder if this is related to the buildpack update today. I still can't figure it out.

I'm using the buildpack for my harpjs app.

Many thanks.

screen shot 2015-02-18 at 5 25 01 pm

harlley commented 9 years ago

+1

devinhalladay commented 9 years ago

+1 for me as well. The latest update broke something. I've tried running heroku run npm install node-sass and that goes swimmingly but my server still crashes with the same error.

devinhalladay commented 9 years ago

I forked this and reverted to the previous commit 4c8ac2afc3284225b169ee0426a54e24d8ab89ad and tried changing my heroku build pack to my fork and it was still broken, same error and everything. This could mean it's a problem with either heroku or libsass itself, but then again I really have no idea what I'm talking about.

zeke commented 9 years ago

Yeah this happened to me too. I know that the lib-sass dependency has given the Harp people a lot of grief, but I don't know specifically why this is now failing. cc @kennethormandy and @sintaxi

I wonder if maybe Heroku is using a new default node or iojs version? cc @hunterloftis

I worked around this by not using the harp buildpack. It turns out you can pretty easily run harp apps on Heroku using the default Node.js buildpack:

Then set the following in your package.json scripts stanza:

{
  "scripts": {
    "start": "NODE_ENV=production harp server -p $PORT",
    "dev": "harp server"
  }
}

The default node buildpack will use your scripts.start value to create a Procfile. Now all you have to do is git commit and git push heroku master and you should be back in business!

zeke commented 9 years ago

I bet it's because of Node 0.12.0: https://semver.io/node.json

Another possible workaround: set engines.node to 0.10.x in your package.json.

If you're using npe you can do it from the command line:

npe engines.node 0.10.x
sintaxi commented 9 years ago

FWIW - there were a couple builds of Harp recently (v0.15.0 & v0.15.1) that did not behave with node v0.12.0. This was resolved with v0.15.2 but there was a 3 day window where you could have had issue. Sorry for any trouble this may have caused.

If there is anything else we can do to help please let me know.

hunterloftis commented 9 years ago

Yep, likely it's unpinned installs bumping to 0.12.0 (from 0.10.x, the previous stable branch). :+1: for Zeke's solution above detailing using the stock buildpack + Harp and :+1: for engines.node in package.json!

hayksaakian commented 9 years ago

i just made a brand new app following instructions in the readme

still seems broken for the same reason as the issue @sintax is heroku caching an old version or something? is there some way to purge their cache, or at least specify a specific commit hash to use for the buildpack?

hunterloftis commented 9 years ago

I just deployed a test harp server (0.12.1) without issue using the standard buildpack:

in package.json, specify:

"dependencies": {
    "harp": "~0.12.1"
  },
"scripts": {
    "start": "node server.js"
  },
"engines": {
    "node": "0.10.x"
  },

in server.js:

require('harp').server(__dirname, { port: process.env.PORT || 9000 })

...and that's it.

markpundsack commented 9 years ago

16 fixes this for me, although may conflict philosophically.