Meteor: 'Error: Cannot find module..' when deploying to heroku. #144

olanod opened this Issue Mar 3, 2013 · 9 comments


None yet

3 participants


When using the heroku-buildpack-meteorite to deploy my meteor app to heroku I get this error where blade node-module can not be imported from the package.js file.

@bminer bminer was assigned Mar 4, 2013

OK, yeah... this is super lame. Could you do me a favor and make the following changes to Blade's /meteor/package.js file and post the results here?

On line 1 (or anywhere at the top of package.js, please add the following code:

console.log("__dirname", __dirname);
console.log("__filename", __filename);
console.log("process", process);
console.log("process.cwd()", process.cwd() );
console.log("module", module);
console.log("main module", require.main);

Then, run the build process again, and post the results printed to the console. I'll use the output to derive some sort of patch for Blade. Thanks in advance!!!


Here is the debug info. I excluded console.log("__dirname", __dirname);,console.log("__filename", __filename); and console.log("module", module); because I was getting ReferenceError: XXXXX is not defined.

@bminer bminer added a commit that closed this issue Mar 6, 2013
@bminer Fixed a bunch of Meteor stuff:
- Cleaned up Meteor `package.js` file to fix `require("blade")` hacks. Should fix #144.
- Now considering `client/views` folder to be in the root namespace. Closes #143.
- Fixed view helpers. They can now be used just like view locals. Also closes #136.
Push to version 3.0.0beta8
@bminer bminer closed this in a050d0d Mar 6, 2013

Please confirm that this bug has been fixed in Blade 3.0.0beta8. Thanks!


Now I got a different error but I think it's related. Before the problem was during package installation but now I'm getting this on meteor initialization.

@bminer bminer reopened this Mar 9, 2013

@olanod - Honestly, I have no idea what the problem is here... it's this stupid hack that I have to do to call require("blade"). Meteor overrides require with its own function, which is kinda lame...

Anyway, the Meteor team is actively working on this in the "engine" branch. Once they fix it, the Blade smart package should work just fine. In the meantime, I'll keep this issue open.

For more info see:!topic/meteor-talk/b6zQrgk8lYo


+1 👍

@bminer bminer added a commit that closed this issue Apr 8, 2013
@bminer Push to 3.2.0
Fixed newline bug in parser for attributes and parameter lists (closes #155)
Added some new tests
Removed horrible hack for Meteor smart package thanks to Meteor 0.6 improvements (closes #144) (closes #161)
Removed some hacks in NPM postinstall script that were previously needed for Meteor support
@bminer bminer closed this in 1ea24e7 Apr 8, 2013

Please confirm that this is working as of Blade 3.2.2


Working with Blade 3.2.2!


Awesome! You can thank the Meteor dev team for this fix. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment