reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.

Home Page:https://mailchimp.com/developer/open-commerce/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

have trouble deploying the sample

victor112991 opened this issue · comments

I use cloud9 to deploy the sample to heroku,

Here is the link I follow to deploy. Everything looks good.
https://docs.reactioncommerce.com/reaction-docs/master/deploying-reaction-using-heroku

But after git push heroku master, there is nothing on the page. I go to inspect and get the following message

Error invoking SubsManager.subscribe("Inventory"): Subscription 'Inventory' not found
be55425….js?meteor_js_resource=true:229 BlazeLayout warning: unknown template "coreLayout"

Anyone can tell me where is the problem?

commented

I too get this issue in heroku from version v0.15.0.
v0.14.1 works fine in heroku.

This appears to be because the plugin loader stuff doesn't happen unless you use reaction-cli or build the app with Docker. So it looks like we need to create our own Heroku buildpack if we're going to officially support Heroku deployment. We unfortunately have enough specific needs in the build process that we can't really assume builds will work the same way in every Meteor build environment (which is why we generally recommend everyone use Docker - it guarantees consistency no matter where you deploy it).

So if we need to create a fork of the horse buildpack, the change needs to happen right here before the meteor build. You could probably just add a single line there that runs the bash version of the plugin loader. That's exactly what the Docker build does right before building the app.

I made some changes to the horse buildpack as suggested by @jshimko and the deploy worked perfectly.

@victor112991 and @vigyano you can use my fork.

heroku buildpacks:set https://github.com/swrdfish/meteor-buildpack-horse.git

Can't get it to work. I'm getting the following errors:

cfs:gridfs: updating npm dependencies -- mongodb, gridfs-stream...
Warning: unable to resolve "stage-2" in presets of /tmp/build_66ee8091063c406ed58efb30960cb1a0/.babelrc
Unable to resolve some modules:
  "autoprefixer" in
/tmp/build_66ee8091063c406ed58efb30960cb1a0/server/api/core/ui.js
(os.linux.x86_64)
If you notice problems related to these missing modules, consider running:
  meteor npm install --save autoprefixer

I've tried with @swrdfish and AdmitHub buildpacks

Also tried with RC master & development branches in free & paid dynos 🤔

@joseconstela That error is definitely because meteor npm install isn't being run. And I guarantee the original horse buildpack won't work for you. You will definitely need to use the fork @swrdfish posted.

heroku buildpacks:set https://github.com/swrdfish/meteor-buildpack-horse.git
commented

@swrdfish fork does not work anymore with master, development branches. anything changed?

@vigyano I haven't changed anything. I deployed the development branch.. and things seem to work fine except the styles were not loaded properly which i guess is a configuration issue. Do you have a similar issue or is there something else. I'll look into the issue further when I get some time.

The styles not loading is because reaction-cli now reads all of the stylesheets from the plugins and then creates an imports file for them. The heroku buildpack doesn't have this change, so no stylesheets are being imported from all of the plugins in the imports folder.

Unfortunately, the Heroku buildpack and Heroku in general are not officially supported by the Reaction team. We're happy to answer questions, but we won't be updating or maintaining any buildpacks and we can't offer any support on Heroku deployments.

Of course, that doesn't mean it can't work. It just means it won't be officially supported. If someone wants to maintain a buildpack, I'd be happy to point you in the right direction on what needs to be fixed. The best update you could make would probably be to install reaction-cli in the buildpack, then use that to build the app (instead of the bash script that is currently there).

Otherwise, our recommendation is always to deploy Reaction with Docker since it's our officially supported method. Our Docker build will always have the latest requirements for a production deployment.

@jshimko thank you for pointing it out. I'll make the necessary changes to my fork.

@swrdfish any updates on making changes to your fork, as I'm still getting the error due to the buildpack.

@mo2menelzeiny I have updated the buildpack. Check if it works.

sorry for the delay, I was out trekking 😃