My Meteor app works flawlessly on localhost, but when deployed to a remote heroku
server, I encounter these errors.
(I am following this)
Any suggestions on how to resolve this issue?
2016-09-09T13:26:02.533532+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node .meteor/heroku_build/app/main.js`
2016-09-09T13:26:06.806440+00:00 heroku[web.1]: Process exited with status 1
2016-09-09T13:26:06.813921+00:00 heroku[web.1]: State changed from starting to crashed
2016-09-09T13:26:06.704013+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:280
2016-09-09T13:26:06.704027+00:00 app[web.1]: throw(ex);
2016-09-09T13:26:06.704028+00:00 app[web.1]: ^
2016-09-09T13:26:06.704031+00:00 app[web.1]: Error: Can't find npm module 'moment'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
2016-09-09T13:26:06.704032+00:00 app[web.1]: at Object.Npm.require (/app/.meteor/heroku_build/app/programs/server/boot.js:198:17)
2016-09-09T13:26:06.704035+00:00 app[web.1]: at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
2016-09-09T13:26:06.704036+00:00 app[web.1]: at Array.forEach (native)
If I log onto Heroku with heroku run bash
, I see the following in /app/typings/globals
:
es6-collections es6-promise google-maps google.maps meteor moment
This matches what is on my Windows localhost:
https://i.sstatic.net/ABhi6.png
The 'moment' modules are also present in node_modules
https://i.sstatic.net/wKCX3.png
Here is the content of
my node_modules\moment\package.js
:
var profile = {
resourceTags: {
ignore: function(filename, mid){
// only include moment/moment
return mid != "moment/moment";
},
amd: function(filename, mid){
return /\.js$/.test(filename);
}
}
};
My package.json
:
{
...
"dependencies": {
"@angular/common": "^2.0.0-rc.4",
...
"zone.js": "^0.6.12"
},
Logs snippet during deployment:
remote: -----> Building Meteor app with ROOT_URL: https://git.heroku.com/remote-thewhozoo.git
...
index.d.ts module for 'moment':
declare module 'moment' {
var moment: moment.MomentStatic;
export = moment;
}
I have symbolic links in the root of the Meteor project:
https://i.sstatic.net/I0tsM.png
UPDATE
I believe I've identified the problem, but not sure how to fix it yet.
The issue seems to be that symbolic links point to directories existing locally but not on the remote server.
https://i.sstatic.net/2fcfo.png
UPDATE
I removed all symbolic links and placed the files instead, redeployed, but still getting the same error when the server attempts to start:
2016-09-11T15:23:06.155551+00:00 heroku[web.1]: State changed from crashed to starting
...
Any suggestions please?
I ran: meteor npm install --save
In boot.js
, I found this code, but unsure about the author's intent:
try {
return require(name);
} catch (e) {
...
}
UPDATE
I removed the .gitignore
file of node_modules/
, and now no longer encountering any errors.
https://i.sstatic.net/jXoRL.png
However, being new to Meteor, I'm unsure how to test this. When trying to access the app via
http://remote-thewhozoo.herokuapp.com/
or https://remote-thewhozoo.herokuapp.com/
, I receive a 404 error:
2016-09-11T16:20:15.183895+00:00 heroku[router]: at=info method=GET path="/sockjs/info?cb=jwgw2yuvgl" host=remote-thewhozoo.herokuapp.com request_id=a49fafb2-9708-46d2-8117-2c789bfa6a3e fwd="105.186.215.147" dyno=web.1 connect=1ms service=2ms status=404 bytes=132
https://i.sstatic.net/7ZUPP.png
I verified the Mongo Database has the collections created by my app. So the Meteor application must be running, just figuring out how to access it.
https://i.sstatic.net/yx09c.png
Any thoughts on this?