These are chat archives for reactioncommerce/reaction

23rd
Mar 2017
premcool
@premcool
Mar 23 2017 00:50

@aaronjudd @zenweasel Thanks for the response. These are my steps 1. Downloaded 1.0 zip in a directory and unzipped

  1. meteor reset
  2. npm init
  3. meteor npm install
  4. meteor run

This started the app successfully with login and password. However the browser shows white screen and Javascript console shows kadira_blaze-layout.js:199 BlazeLayout warning: unknown template "notFound"
I'm using Windows 10 machaine and Meteor version 1.4.3.2, and node v4.7.3
I had previously used reaction 19.0 and it was working. So not able to figure out where I'm going wrong.

Brent Hoover
@zenweasel
Mar 23 2017 01:02
if there a reason you chose to do that rather than follow the install instructions?
And you defintely need to be using the reaction command to run Reaction. That’s not optional
premcool
@premcool
Mar 23 2017 01:57
@zenweasel Awesome. It works with reaction command. I thought reaction command was just an extension of meteor command with default settings configuration, maybe I was mistaken. Many thanks..
Brent Hoover
@zenweasel
Mar 23 2017 01:57
No, it’s needed to set up the plugin/styles imports correctly.
xuanvinhvu
@xuanvinhvu
Mar 23 2017 02:01
I’m trying to run reaction but it fails with the following error. I have meteor installed is this a problem?
=> Started proxy.
=> Started MongoDB.
cfs:gridfs: updating npm dependencies -- mongodb, gridfs-stream...
/Users/bo/.meteor/packages/coffeescript/.1.11.1_4.vlysyr++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
      throw error;
      ^

Error: ENFILE: file table overflow, scandir '/Users/bo/IdeaProjects/test/reaction/packages/gridfs'
    at Error (native)
    at Object.fs.readdirSync (fs.js:808:18)
    at Object.wrapper (/tools/fs/files.js:1535:35)
    at readDirectory (/Users/bo/.meteor/packages/meteor-tool/.1.4.3_2.1bvf0xf++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:338:26)
    at Watcher._fireIfDirectoryChanged (/Users/bo/.meteor/packages/meteor-tool/.1.4.3_2.1bvf0xf++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:490:23)
    at /Users/bo/.meteor/packages/meteor-tool/.1.4.3_2.1bvf0xf++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:747:12
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/bo/.meteor/packages/meteor-tool/.1.4.3_2.1bvf0xf++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
    at Watcher._checkDirectories (/Users/bo/.meteor/packages/meteor-tool/.1.4.3_2.1bvf0xf++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:736:7)
    at new Watcher (/Users/bo/.meteor/packages/meteor-tool/.1.4.3_2.1bvf0xf++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fs/watch.js:435:10)
    at setupClientWatcher (/tools/runners/run-app.js:800:23)
Brent Hoover
@zenweasel
Mar 23 2017 02:04
Check out this section of the docs under EMFILE, too many open files
https://docs.reactioncommerce.com/reaction-docs/master/requirements
xuanvinhvu
@xuanvinhvu
Mar 23 2017 02:09
yea i did a google search found it
testing it out. thanks
Very nice it’s working
Brent Hoover
@zenweasel
Mar 23 2017 02:14
:+1:
CisumInas
@cisuminas
Mar 23 2017 11:06
Hey, how much memmory do you deploy with in the case of reaction, my understanding is https://docs.reactioncommerce.com/reaction-docs/master/deploying
the recommendation is 2GB, is this correct?
Brent Hoover
@zenweasel
Mar 23 2017 11:07
Yes, that’s correct
CisumInas
@cisuminas
Mar 23 2017 11:08
:(
Feels like a lot..
any one has an example with an reaction app online?
CisumInas
@cisuminas
Mar 23 2017 11:11
@zenweasel thx, already seen that one, actually only reaction app ive seen so far
any other examples?
Brent Hoover
@zenweasel
Mar 23 2017 11:14
This is our newest partner who is moving to Reaction: https://www.evereve.com/
CisumInas
@cisuminas
Mar 23 2017 11:19
@zenweasel nice, running on 2gb + ?
Brent Hoover
@zenweasel
Mar 23 2017 11:41
I don’t know what Michael is running Easywine on
Yuriy
@furkoyuriy_twitter
Mar 23 2017 17:12
hi
How i can run Reaction with nginx ?
Jakub Bąbelek
@jakoboo
Mar 23 2017 17:19

ok so i did everything like in docs for making new layout and i keep getting error Oops! This page was not found.on website. everything is fine until I try to import defaults

my defaults:

import { Session } from "meteor/session";

Session.set("DEFAULT_LAYOUT", "coreLayoutNpb");
Session.set("DEFAULT_WORKFLOW", "coreWorkflow");

my core.html:

<template name="coreLayoutNpb">
...

and register.js:

...
layout: [{
    layout: "coreLayoutNpb",
    workflow: "coreProductWorkflow",
    collection: "Products",
    theme: "default",
    enabled: true,
    structure: {
...

i am importing ./templatesand ./layouts/core.html etc

@furkoyuriy_twitter google nginx proxy_pass, should help you ^^
Spencer Norman
@spencern
Mar 23 2017 17:25
@jakoboo - have you restarted / reset your app since adding the layout to register .js
Jakub Bąbelek
@jakoboo
Mar 23 2017 17:25
multiple times
Spencer Norman
@spencern
Mar 23 2017 17:25
I’m not 100% certain about how this works, but I know I’ve gotten it to work before, let me check a few things and get back to you
Mike Murray
@mikemurray
Mar 23 2017 17:27
might be related to this ticket: reactioncommerce/reaction#2003
Seun Martins
@impactmass
Mar 23 2017 17:56
@jakoboo check if that ^ relates to your problem
Jakub Bąbelek
@jakoboo
Mar 23 2017 18:08
ok so after i manually changed Item 12 inside Shops collection, it's working = displaying the page.
But what if i want to use different workflow than coreProductGridWorkflow which seems to be only one working (previously had coreWorkflow)
Yuriy
@furkoyuriy_twitter
Mar 23 2017 18:22
hi
How i can use reaction with Nginx ?
when i use reaction or meteor i must use ip:3000 port
How i can run reaction -d and use nginx upstream?
Jakub Bąbelek
@jakoboo
Mar 23 2017 18:25

server {
  listen 80;
  server_name example.com;

  location / {
    access_log off;
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
Yuriy
@furkoyuriy_twitter
Mar 23 2017 18:25
thank you
how you run reaction server in
background ?
Jakub Bąbelek
@jakoboo
Mar 23 2017 18:27
you can use screen for development
Yuriy
@furkoyuriy_twitter
Mar 23 2017 18:29
scren --> reacrion It's will correct way ?
I try but i writing ansible deployment now, and thing it's bad idea use screan
Jeremy Shimko
@jshimko
Mar 23 2017 20:20
You shouldn’t ever be using the reaction command in production. That is not creating an optimized production build. It's strictly for local development. So there’s never a point where you should be trying to find a way to run the reaction command in the background. Instead, you need to create a production build that you run as a regular Node app. Our recommended method is by using our Docker build process. From the root of your project, run:
# build your custom image
docker build -t dockeraccount/reaction:latest .

# run your custom image
docker run -d \
  -p 80:3000 \
  -e ROOT_URL="http://<your app url>" \
  -e MONGO_URL="mongodb://<your mongo url>" \
  -e REACTION_EMAIL="youradmin@yourdomain.com" \
  -e REACTION_USER="admin-username" \
  -e REACTION_AUTH="admin-password" \
  your-docker-account/reaction:latest
Yuriy
@furkoyuriy_twitter
Mar 23 2017 20:21
thank for recomendation
Jeremy Shimko
@jshimko
Mar 23 2017 20:22
To do the same thing, but with Nginx in front of it as a reverse proxy…
# start the nginx proxy
docker run -d -p 80:80 \
  -v /var/run/docker.sock:/tmp/docker.sock:ro \
  jwilder/nginx-proxy:latest

# then start your custom image with a virtual host name/port set
docker run -d \
  -e ROOT_URL="http://example.com" \
  -e MONGO_URL="mongodb://<your mongo url>" \
  -e REACTION_EMAIL="youradmin@yourdomain.com" \
  -e REACTION_USER="admin-username" \
  -e REACTION_AUTH="admin-password" \
  -e VIRTUAL_HOST="example.com" \
  -e VIRTUAL_PORT=3000 \
  your-docker-account/reaction:latest
Yuriy
@furkoyuriy_twitter
Mar 23 2017 20:22
how i can use volume ( -v ) in docker ?
-v $pwd: <what use folder> ?
Jeremy Shimko
@jshimko
Mar 23 2017 20:23
what are you trying to do with the volume?
Yuriy
@furkoyuriy_twitter
Mar 23 2017 20:25
for update code
i not undestand how i can write code and deploy on development server
Jeremy Shimko
@jshimko
Mar 23 2017 20:25
docker is only for production deployments. you don’t ever edit the code inside a container.
you edit the code in development and then build a new docker image when you’re done
Yuriy
@furkoyuriy_twitter
Mar 23 2017 20:27
i try
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:24
how can i delete shop name from url?
Brent Hoover
@zenweasel
Mar 23 2017 22:32
Just remove the second shop in Shops.json
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:33
ohh thanks ^^
is there something to categorize products or default way to do this is to just use tags?
Brent Hoover
@zenweasel
Mar 23 2017 22:34
Yes, you would use tags
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:37
thanks and last (sorry for noob questions) is there a way to make custom layout and use default one for things i don't change? sth like sub-layout
cause now i am getting 'oops! this page was not found'
i know about index_options but i can't get it to work :/
Brent Hoover
@zenweasel
Mar 23 2017 22:40
Are you trying to only override the home page?
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:40
not only the homepage and i don't want to override every single one that is available either
Brent Hoover
@zenweasel
Mar 23 2017 22:41
Are you using the example-plugin?
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:41
yes
Brent Hoover
@zenweasel
Mar 23 2017 22:42
So in the example plugin code there is a function that overrides the layout template for every layout. You will want to comment out that code and create a new layout record for every one that you want to override
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:42
i mean... i started with it but now it's modified (i changed ui-navbar etc)
so Session.set("DEFAULT_LAYOUT", "npbLayout"); overrides all right?
proper way is something like Session.set("DEFAULT_HEADER", "npbHeader");?
Brent Hoover
@zenweasel
Mar 23 2017 22:43
No
You see this code in the register.js of the example-plugin?
  layout: [{
    layout: "coreLayoutBeesknees",
    workflow: "coreProductGridWorkflow",
    collection: "Products",
    theme: "default",
    enabled: true,
    structure: {
      template: "productsLanding",
      layoutHeader: "layoutHeader",
      layoutFooter: "layoutFooter",
      notFound: "productNotFound",
      dashboardHeader: "",
      dashboardControls: "dashboardControls",
      dashboardHeaderControls: "",
      adminControlsFooter: "adminControlsFooter"
    } }
  ]
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:45
yes
that's what i use (slightly modified)
Brent Hoover
@zenweasel
Mar 23 2017 22:46
Actually, just give me a few minutes to send my kids off to school here...
Jakub Bąbelek
@jakoboo
Mar 23 2017 22:47
np
Brent Hoover
@zenweasel
Mar 23 2017 23:09
so let’s take a step back real quick and try to solve your 404 problem. Are you setting values for the SESSION settings?
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:10
yup, in my default.js
Session.set("DEFAULT_LAYOUT", "npbLayout");
Session.set("DEFAULT_WORKFLOW", "coreWorkflow");
Brent Hoover
@zenweasel
Mar 23 2017 23:10
Can you try removing those?
You shouldn’t need to reset
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:11
so (if i dont need to reset) everything is working as it was
Brent Hoover
@zenweasel
Mar 23 2017 23:11
you’re still getting the 404?
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:11
yes
i'll restart just to check
Brent Hoover
@zenweasel
Mar 23 2017 23:11
Ok, then there’s a problem with the changes you have made.
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:12
import { Reaction } from "/server/api";


Reaction.registerPackage({
  label: "Nowa Platforma Budowlana",
  name: "npb",
  icon: "fa fa-vine",
  autoEnable: true,
  layout: [{
    layout: "npbLayout",
    workflow: "coreProductGridWorkflow",
    collection: "Products",
    theme: "default",
    enabled: true,
    structure: {
      template: "productDetail",
      layoutHeader: "npbHeader",
      layoutFooter: "layoutFooter",
      notFound: "productNotFound",
      dashboardHeader: "",
      dashboardControls: "dashboardControls",
      dashboardHeaderControls: "",
      adminControlsFooter: "adminControlsFooter"
    }
  }]
});
this is my entire register.js
and this only displays 'home' page. I cant open profile etc
Brent Hoover
@zenweasel
Mar 23 2017 23:13
Did you make the changes in init.js?
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:13
no
Brent Hoover
@zenweasel
Mar 23 2017 23:13
Because I have the plugin checked out here locally and it’s working fine
/**
 * Hook to make additional configuration changes
 */
Hooks.Events.add("afterCoreInit", () => {
  modifyCheckoutWorkflow();
  addRolesToVisitors();
  changeLayouts(Reaction.getShopId(), "coreLayoutBeesknees");
});
As mentioned in the tutorial, that will change the default layout to be “coreLayoutBeesKnees"
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:18
ok it's working now after i did reaction reset like 5th time :x
Brent Hoover
@zenweasel
Mar 23 2017 23:19
Great
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:21
Thank you for help ^^ school tomorrow and it's like 00:20 here and i am trying to get this to work... really steep learning curve :c
Brent Hoover
@zenweasel
Mar 23 2017 23:21
Sorry you feel that way
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:22
i mean... it's great and i really want to learn reaction ^^ but i just cant wrap my head around some things
Brent Hoover
@zenweasel
Mar 23 2017 23:23
Yeah, there’s a lot to take in all at once, especially if you are new to Meteor
Jakub Bąbelek
@jakoboo
Mar 23 2017 23:24
it's my first contact with it tbh xD
Brent Hoover
@zenweasel
Mar 23 2017 23:27
I think you will find in the long run that Meteor makes developing with Javascript a lot less painful