Pages

Thursday, May 12, 2016

Learning Meteor.js [Part 19]: Update Heroku buildpack to support npm packages

On a previous post I mentioned that I started using npm packages directly with meteor. This is a great improvement from being limited to what is available on atmosphere.js, unfortunately, the application failed to run when deployed to heroku with errors like this:
-----> Building Meteor App Bundle
       
  Unable to resolve some modules:
       
  "postal" in /tmp/build_2683d2d41b6a9fef4dc23088ea9a8e15/app_src/imports/ui/parts/recipeDetailsPart.js (web.browser)
  "fractional" in /tmp/build_2683d2d41b6a9fef4dc23088ea9a8e15/app_src/imports/ui/parts/recipeDetailsPart.js (web.browser)

Turns out the buildpack that I was using does not support installing packages from npm. Curses! I tried modifying the builpack myself but could not figure out where heroku places the package.json file to run 'npm install'.

After giving up on that, I fortunately found another buildpack that is much better maintained and that supports npm package restore: https://github.com/AdmitHub/meteor-buildpack-horse. It also supports the latest meteor version 1.3.2.4, so that was a plus. With this change in place the application is back alive.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.