heroku / heroku-buildpack-emberjs

**This buildpack is deprecated!** Please use the official Node.js buildpack combined with the static or nginx buildpack instead.
71 stars 28 forks source link

Buildpack succeeding but throwing application error #38

Closed mrispoli24 closed 7 years ago

mrispoli24 commented 7 years ago

Hello I built an ember app locally with fastboot and then tried to deploy to Heroku using the documentation.

The build succeeds but the app will not serve:

image

I'm not sure what is going on there doesn't seem to be much useful in the logs on the build side. There are s few warnings on the build but I don't know if those have much do do with it.

remote: Built project successfully. Stored in "dist/".
remote: File sizes:
remote:  - dist/assets/cause-of-a-kind-36ba59df6af0926b7d2b182b5dab1351.js: 30.05 KB (4.21 KB gzipped)
remote:  - dist/assets/cause-of-a-kind-9945a7ffd5788e9e13a8ee4249b17db8.css: 119.15 KB (20.36 KB gzipped)
remote:  - dist/assets/cause-of-a-kind-fastboot-57855ccffe91a865b89ee8e7e478da20.js: 1.38 KB (696 B gzipped)
remote:  - dist/assets/vendor-adca485bb35a51a19580583d38b086b8.js: 872.24 KB (216.17 KB gzipped)
remote:  - dist/assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css: 0 B
remote: -----> Loading old ember assets
remote: -----> Caching ember assets
remote: -----> ember fastboot detected
remote: -----> Installing fastboot dependencies
remote: npm WARN dist No description
remote: npm WARN dist No repository field.
remote: npm WARN dist No license field.
remote: -----> Caching fastboot dependencies
remote: -----> ember-fastboot command not detected, installing fastboot-cli
remote: npm WARN deprecated fs-promise@0.3.1: Use mz or fs-extra^3.0 with Promise Support
remote: npm WARN caoptionalu SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
remote: se-ofnpm-a -WARNki ndnotsup@ SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

In my logs I see the following:

2017-06-12T11:51:07.986332+00:00 app[web.1]: Error: ENOENT: no such file or directory, open '/app/dist/assets/vendor.js'
2017-06-12T11:51:07.986333+00:00 app[web.1]:     at Object.fs.openSync (fs.js:558:18)
2017-06-12T11:51:07.986334+00:00 app[web.1]:     at /app/node_modules/fastboot/src/ember-app.js:141:27
2017-06-12T11:51:07.986333+00:00 app[web.1]:     at Object.fs.readFileSync (fs.js:468:33)
2017-06-12T11:51:07.986335+00:00 app[web.1]:     at Array.forEach (native)
2017-06-12T11:51:07.986336+00:00 app[web.1]:     at EmberApp.loadAppFiles (/app/node_modules/fastboot/src/ember-app.js:139:21)
2017-06-12T11:51:07.986337+00:00 app[web.1]:     at EmberApp.retrieveSandboxedApp (/app/node_modules/fastboot/src/ember-app.js:187:10)
2017-06-12T11:51:07.986337+00:00 app[web.1]:     at new EmberApp (/app/node_modules/fastboot/src/ember-app.js:50:21)
2017-06-12T11:51:07.986338+00:00 app[web.1]:     at FastBoot._buildEmberApp (/app/node_modules/fastboot/src/index.js:114:17)
2017-06-12T11:51:07.986339+00:00 app[web.1]:     at new FastBoot (/app/node_modules/fastboot/src/index.js:52:10)
2017-06-12T11:51:07.986339+00:00 app[web.1]:     at Worker.buildMiddleware (/app/node_modules/fastboot-app-server/src/worker.js:63:21)
2017-06-12T11:51:07.998360+00:00 app[web.1]: [2017-06-12T11:51:07.998Z][m4] worker exited with error code: 1
2017-06-12T11:51:08.072251+00:00 app[web.1]: [2017-06-12T11:51:08.072Z][m4] forked worker 3058
2017-06-12T11:51:08.072356+00:00 app[web.1]: [2017-06-12T11:51:08.072Z][m4] worker online
2017-06-12T11:51:08.120052+00:00 app[web.1]: fs.js:558
2017-06-12T11:51:08.120055+00:00 app[web.1]:   return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);

I did make a change so that my node version is the same one as I am using locally in the package.json but this doesn't seem to have helped. Would just creating a vendor.js file be the answer here?

Dhaulagiri commented 7 years ago

I noticed something similar last week but didn't have time to dig in. I don't think the issue is related to this buildpack though since I get the same error locally if I run ember serve --environment production. Can you confirm you see the same thing?

mrispoli24 commented 7 years ago

@Dhaulagiri yep I see the same thing serving production locally:

Error: ENOENT: no such file or directory, open '/Users/M/code/cause_of_a_kind/tmp/srihash_assets-output_path-NqgWyF3s.tmp/assets/vendor.js'
    at Object.fs.openSync (fs.js:558:18)
    at Object.fs.readFileSync (fs.js:468:33)
    at /Users/M/code/cause_of_a_kind/node_modules/fastboot/src/ember-app.js:141:27
    at Array.forEach (native)
    at EmberApp.loadAppFiles (/Users/M/code/cause_of_a_kind/node_modules/fastboot/src/ember-app.js:139:21)
    at EmberApp.retrieveSandboxedApp (/Users/M/code/cause_of_a_kind/node_modules/fastboot/src/ember-app.js:187:10)
    at new EmberApp (/Users/M/code/cause_of_a_kind/node_modules/fastboot/src/ember-app.js:50:21)
    at FastBoot._buildEmberApp (/Users/M/code/cause_of_a_kind/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/Users/M/code/cause_of_a_kind/node_modules/fastboot/src/index.js:52:10)
    at app.use (/Users/M/code/cause_of_a_kind/node_modules/ember-cli-fastboot/index.js:233:29)
mrispoli24 commented 7 years ago

One thing I noticed is that I didn't install yarn for my app, I didn't think that would be necessary for this though.

Dhaulagiri commented 7 years ago

I'm going to close this since this doesn't appear to be a buildpack issue, but if you learn otherwise feel free to re-open.

I haven't been keeping up with fastboot lately so I'm not sure where this error is coming from, but we may want to raise an issue over there to see what might be causing this.

mrispoli24 commented 7 years ago

Thanks @Dhaulagiri for pointing me in the right direction. I'll have some time to dig into it more later too to see if I can find the issue.

oskarrough commented 7 years ago

Hi, it looks like you've run into this https://github.com/ember-fastboot/ember-cli-fastboot/issues/424.

Not sure why but you can hopefully make it work by updating ember-cli-build.js like this:

fingerprint: {
  generateAssetMap: EmberApp.env() === 'production'
}