Search code examples
node.jsherokuember.jsember-cli

can't push ember cli app to heroku due to broccoli-sass and node-sass


I've been trying to deploy to Heroku and it keeps throwing me an error. Apparently node 0.12 was not compatible with node-sass so I updated to node-sass 2.0.1 but it still doesn't work. I'm using ember cli 0.1.15

Module did not self-register.
       Error: Module did not self-register.
           at Error (native)
           at Module.load (module.js:355:32)
           at Function.Module._load (module.js:310:12)
           at Module.require (module.js:365:17)
           at require (module.js:384:17)
           at Object.<anonymous> (/tmp/build_9fa8a1b16bb172aacd5dffe37fe967c1/node_modules/broccoli-sass/node_modules/node-sass/lib/index.js:181:15)
           at Module._compile (module.js:460:26)
           at Object.Module._extensions..js (module.js:478:10)
           at Module.load (module.js:355:32)
           at Function.Module._load (module.js:310:12)

 !     Push rejected, failed to compile Ember CLI app

Solution

  • The issue is happening because Heroku is using the last version of nodejs 0.12.0 which is incompatible with node-sass < 2.0.1 which is being use by broccoli-sass, you updated your local version of node-sass but broccoli-sass is still using the old version of node-sass There are some pull requests on broccoli-sass to fix that issue

    https://github.com/joliss/broccoli-sass/pull/49 https://github.com/joliss/broccoli-sass/pull/43

    Meanwhile you can modify your package.json

    from

      "engines": {
        "node": ">= 0.10.0"
      }
    

    to

      "engines": {
        "node": "0.10.x"
      }