These are chat archives for reactioncommerce/reaction

8th
Feb 2018
Patrick Newell
@pnewell4_twitter
Feb 08 2018 03:00
before I dive too deeply into this, does this error mean anything to anyone?
=> App running at: http://localhost:4000/
Exception while invoking method 'login' Error: insert requires an argument
    at Mongo.Collection.insert (packages/mongo/collection.js:429:11)
    at Mongo.Collection.(anonymous function) (packages/aldeed_collection2-core.js:232:19)
    at Mongo.Collection.(anonymous function) [as insert] (packages/dispatch_run-as-user.js:325:19)
    at AccountsServer.Ap.insertUserDoc (packages/accounts-base/accounts_server.js:1325:25)
    at DDPCommon.MethodInvocation.<anonymous> (server/startup/accounts.js:56:29)
    at packages/accounts-base/accounts_server.js:468:32
    at tryLoginMethod (packages/accounts-base/accounts_server.js:245:14)
    at AccountsServer.Ap._runLoginHandlers (packages/accounts-base/accounts_server.js:465:18)
    at DDPCommon.MethodInvocation.methods.login (packages/accounts-base/accounts_server.js:528:27)
    at packages/check.js:128:16
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
    at Object._failIfArgumentsAreNotAllChecked (packages/check.js:127:41)
    at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1765:18)
    at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
    at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
    at Promise (packages/ddp-server/livedata_server.js:715:46)
    at new Promise (<anonymous>)
    at Session.method (packages/ddp-server/livedata_server.js:689:23)
    at packages/ddp-server/livedata_server.js:559:43
(I recently added a new plugin and did a reaction reset. prior to that, I had not been getting this error)
also recently updated the reaction-cli
Brent Hoover
@zenweasel
Feb 08 2018 04:17
did you upgrade to 1.6.1?
Srikanth K
@srikanthkolli
Feb 08 2018 04:38

@prinzdezibel @zenweasel while creating docker image using
docker build --build-arg TOOL_NODE_FLAGS="--max-old-space-size=4096" --build-arg INSTALL_MONGO=true -t reactioncommerce/reaction:latest .

process terminates with below error

sudo chown -Rh <username> .meteor/local /opt/build_scripts/build-meteor.sh: line 30: 5352 Killed meteor build --directory $APP_BUNDLE_DIR The command '/bin/sh -c cd $APP_SOURCE_DIR && $BUILD_SCRIPTS_DIR/install-deps.sh && $BUILD_SCRIPTS_DIR/install-node.sh && $BUILD_SCRIPTS_DIR/install-phantom.sh && $BUILD_SCRIPTS_DIR/install-mongo.sh && $BUILD_SCRIPTS_DIR/install-meteor.sh && $BUILD_SCRIPTS_DIR/build-meteor.sh && $BUILD_SCRIPTS_DIR/post-build-cleanup.sh' returned a non-zero code: 137

Brent Hoover
@zenweasel
Feb 08 2018 04:42
Have you installed bcrypt?
Srikanth K
@srikanthkolli
Feb 08 2018 04:43
nope
Brent Hoover
@zenweasel
Feb 08 2018 04:49
just curious why you are doing -t reactioncommerce/reaction:latest
Srikanth K
@srikanthkolli
Feb 08 2018 04:51
to name the docker image and its optional
Brent Hoover
@zenweasel
Feb 08 2018 04:55
running your command on a fresh clone here
Ran without issue on my machine
Srikanth K
@srikanthkolli
Feb 08 2018 04:59
thankyou. you can find the same command in circleci build file
Brent Hoover
@zenweasel
Feb 08 2018 04:59
Right, just a note that you are tagging it with our org, which you will never be able to push
Successfully built da1c363b4e48
Successfully tagged reactioncommerce/reaction:latest
Srikanth K
@srikanthkolli
Feb 08 2018 05:03
i'm on Mac with 8GB memory out of which 1.5 GB is free. Is this memory enough to build image?
Brent Hoover
@zenweasel
Feb 08 2018 05:06
I honestly don’t know, but that doesn’t seem like a lot of memory
Although if you got an OOM error I would think it would look different
Srikanth K
@srikanthkolli
Feb 08 2018 05:08
okay thankyou i will try to findout
Amalan Jenicious
@amalan-shenll
Feb 08 2018 05:38
hi
i pulled the latest reaction and did docker-compose up
the container image created and running inside docker
but when i click any of link its not redirecting and i used admin@localhost login it shows only few marketplace menus
what i am doing wrong?
aniwebcastle
@aniwebcastle
Feb 08 2018 06:29
Hello all, can i run reaction on other port, except 3000?
Daniel Honig
@dhonig
Feb 08 2018 06:30
@aniwebcastle easy one
reaction -p 8080
aniwebcastle
@aniwebcastle
Feb 08 2018 06:30
and mongodb?
Daniel Honig
@dhonig
Feb 08 2018 06:30
there is a mongo db url env settign
aniwebcastle
@aniwebcastle
Feb 08 2018 06:30
which port?
Daniel Honig
@dhonig
Feb 08 2018 06:30
you can use that to point it to whatever mongo you want
but no command line support for mongo port I know of
aniwebcastle
@aniwebcastle
Feb 08 2018 06:32
dev.settings.json?
in reaction/settings?
Brent Hoover
@zenweasel
Feb 08 2018 06:33
environment variables are the way you should do it
Daniel Honig
@dhonig
Feb 08 2018 06:35
For development purposes I find the smoothest workflow is using the built in mongo....Then for staging, prod environments I run it external
If I remember correctly, I don't think reaction reset will touch an external mongo by default
Brent Hoover
@zenweasel
Feb 08 2018 06:36
that’s correct
Daniel Honig
@dhonig
Feb 08 2018 06:36
thats a good thing too!
Brent Hoover
@zenweasel
Feb 08 2018 06:36
I happen to try this earlier today, so can confirm
Daniel Honig
@dhonig
Feb 08 2018 06:36
plugin not show up in production. Goodbye world!
aniwebcastle
@aniwebcastle
Feb 08 2018 06:36
thanks @zenweasel @dhonig
Daniel Honig
@dhonig
Feb 08 2018 06:37
@aniwebcastle hows everything going in general? You getting the hang of things?
aniwebcastle
@aniwebcastle
Feb 08 2018 06:38
@dhonig is there any workflow explained totally in document? like full account section, hows it goes up?
Daniel Honig
@dhonig
Feb 08 2018 06:38
the guides are in a state of constant improvement
so I would check there and then ask any questions you have here for clarification
Brent Hoover
@zenweasel
Feb 08 2018 06:39
also it’s helpful if you find something that’s not documented, open an issue on the docs repo
Harshal Yeole
@harshalyeole-tudip
Feb 08 2018 06:52
It takes me anywhere from 30 seconds to several minutes for reaction to detect that a change has been made here
Same goes with me.
Daniel Honig
@dhonig
Feb 08 2018 06:55
@harshalyeole-tudip I've been having problems with "filewatching" in reaction 1.7 as well
as a result I have to kill the process and restart
I'm running ArchLinux, you?
Morteza Khamseh
@mori5ive
Feb 08 2018 07:00
Hey, all.. how to add new currency correctly in shop.js file?? I added but not working
Brent Hoover
@zenweasel
Feb 08 2018 07:01
did you reset after making the change?
Daniel Honig
@dhonig
Feb 08 2018 07:02
That would be a fun page for the guides
"When do I need to reset. When do I not need a reset"
its there for the most part, but a nice one pager would be sweet
Brent Hoover
@zenweasel
Feb 08 2018 07:03
when in doubt, reset
Daniel Honig
@dhonig
Feb 08 2018 07:04
protip reaction reset -n if you dont need to reinstall node_modules
signifigant time saver
Brent Hoover
@zenweasel
Feb 08 2018 07:04
Yeah, I have rrr and ryrr shortcuts for reaction reset -n && reaction or reaction reset -y && reaction
Daniel Honig
@dhonig
Feb 08 2018 07:11
@zenweasel just inserted into my .zshrc
aniwebcastle
@aniwebcastle
Feb 08 2018 07:38
Rc takes lot of time to load, after making any change. is there any way to load it fast?
also sometimes need hard refresh to see the change, is there any way to load it fast with modification?
Daniel Honig
@dhonig
Feb 08 2018 08:10
@aniwebcastle thats only on restart...normally changing a file or two should not require a restart meteor/reaction will detect it and then reload the changed file(s)
that should happen quickly
Brent Hoover
@zenweasel
Feb 08 2018 08:10
If you missed the community call last night/this morning you can check out the recording of it here: https://www.youtube.com/watch?v=iGQSOBZgbP4
Has updates on changes to Simple Schema, 2.0 and more
Patrick Newell
@pnewell4_twitter
Feb 08 2018 10:36
@zenweasel circling back to my error from last night (EST), I have not updated to Meteor 1.6.1
=> Meteor 1.6.1 is available. Update this project with 'meteor update'.
(to save you a scroll) any time I try to load the page, I see:
Exception while invoking method 'login' Error: insert requires an argument
    at Mongo.Collection.insert (packages/mongo/collection.js:429:11)
    at Mongo.Collection.(anonymous function) (packages/aldeed_collection2-core.js:232:19)
    at Mongo.Collection.(anonymous function) [as insert] (packages/dispatch_run-as-user.js:325:19)
    at AccountsServer.Ap.insertUserDoc (packages/accounts-base/accounts_server.js:1325:25)
    at DDPCommon.MethodInvocation.<anonymous> (server/startup/accounts.js:56:29)
    at packages/accounts-base/accounts_server.js:468:32
    at tryLoginMethod (packages/accounts-base/accounts_server.js:245:14)
    at AccountsServer.Ap._runLoginHandlers (packages/accounts-base/accounts_server.js:465:18)
    at DDPCommon.MethodInvocation.methods.login (packages/accounts-base/accounts_server.js:528:27)
    at packages/check.js:128:16
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
    at Object._failIfArgumentsAreNotAllChecked (packages/check.js:127:41)
    at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1765:18)
    at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
    at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:15)
    at Promise (packages/ddp-server/livedata_server.js:715:46)
    at new Promise (<anonymous>)
    at Session.method (packages/ddp-server/livedata_server.js:689:23)
    at packages/ddp-server/livedata_server.js:559:43
Patrick Newell
@pnewell4_twitter
Feb 08 2018 10:42
ah... nevermind
it's amazing what a night's sleep can do for debugging!
...I doubt this will come up for too many people, but the issue was that I run my local development on a fake domain, local.brewline.io. When I did a reaction reset, my Shop did no longer had the correct domains value, so Reaction.shopId was not being set.
(This is not at all intuitive from the error message, but it shouldn't happen to many people)
Michael Jenny
@prinzdezibel
Feb 08 2018 10:48
I remember vaguely of having this problem too a long time ago
Patrick Newell
@pnewell4_twitter
Feb 08 2018 11:00
@prinzdezibel do you know off the top of your head where the source is for layouts and workflows?
I am trying to build an onboarding experience for Merchants, so I have created a new layout and workflow, but I'm missing something and would like to better understand each of the options/settings when I register this package
thanks!
Michael Jenny
@prinzdezibel
Feb 08 2018 11:01
workflows/layouts are defined in register.js and copied into shops collection at startup, as they are shop specific
workflow_steps are also defined in register.js and are copied into Packages collections on startup. They are intended to be used by template helpers.
(edited. it's the other way round , actually)
Patrick Newell
@pnewell4_twitter
Feb 08 2018 11:08
ok, yep, I think I am on the right track. one quick question:
in the workflow, the first item in the array is the workflow process and the rest are workflow steps. the workflow process has a structure, and the structure has a template. Is that template supposed to be the first step in the workflow?
Michael Jenny
@prinzdezibel
Feb 08 2018 13:57
not sure if I understand you correctly. But the order in register.js does not matter. you may put workflow_processes first and then workflow_steps. or vice versa. what the template goes: it's the one that's rendered through /imports/plugins/core/router/lib/router.js and serves as container for workflow_steps, if any..
so you may define a workflow(_process) without workflow_steps. this is done in several places, e.g. the index page
i.e. coreProductGridWorkflow
Patrick Newell
@pnewell4_twitter
Feb 08 2018 14:13
thanks @prinzdezibel, that answers the question perfectly.
Harshal Yeole
@harshalyeole-tudip
Feb 08 2018 17:14

Hey Guys,
I have to fetch data from database on my server-side of my plugin.

I am using
const cartData = Collections.Cart.find({userId: userId});

But when I Log the cartData it returns CURSOR.

How do I get the cart data I want to get.

Akarshit Wal
@Akarshit
Feb 08 2018 17:16
const cartData = Collections.Cart.find({userId: userId}).fetch();
Harshal Yeole
@harshalyeole-tudip
Feb 08 2018 17:20
I used .fetch();
and it worked
oh Yes @Akarshit
Thanks :)
Patrick Newell
@pnewell4_twitter
Feb 08 2018 17:21
there is also .findOne() if you are sure you are only getting one result (IIRC, this has some speed savings over .find())
Harshal Yeole
@harshalyeole-tudip
Feb 08 2018 17:29
.findOne(...).fetch is not a function
Patrick Newell
@pnewell4_twitter
Feb 08 2018 17:29
@zenweasel or @prinzdezibel can you point me to the rendering entry point? I would like to set a breakpoint and step through the whole process to better understand some internals
Michael Jenny
@prinzdezibel
Feb 08 2018 17:29
coreLayout?
which would be default
Patrick Newell
@pnewell4_twitter
Feb 08 2018 17:29
@harshalyeole-tudip, right, with findOne you don't need to fetch, you get the data back
Michael Jenny
@prinzdezibel
Feb 08 2018 17:30
try this: imports/plugins/core/layout/client/components/coreLayout.js
Patrick Newell
@pnewell4_twitter
Feb 08 2018 17:30
@prinzdezibel I'd like to start where the route is inspected and mapped to a layout
ok cool, I will start there
Harshal Yeole
@harshalyeole-tudip
Feb 08 2018 17:30
Ok
Michael Jenny
@prinzdezibel
Feb 08 2018 17:32
registering of routes happens on startup. see imports/plugins/core/router/lib/router.js
Patrick Newell
@pnewell4_twitter
Feb 08 2018 17:32
(long story short, I registered a new route with a layout but am getting a blank page)
ok router.js looks perfect
thanks
Michael Jenny
@prinzdezibel
Feb 08 2018 17:33
Yes, the mapping happens there.
ReactionLayout in router.js
const foundLayout = sortedLayout.find((x) => selectLayout(x, layoutName, workflowName));
Harshal Yeole
@harshalyeole-tudip
Feb 08 2018 17:53
Is there any way I can find out if I am logged in? at client side
AndrijWilhite
@AndrijWilhite
Feb 08 2018 18:24
So I am attempting in my plugin to overide addressBookAdd logic under accounts.js whats the best approach to go about this?
AndrijWilhite
@AndrijWilhite
Feb 08 2018 19:25
to clarify under /server/methods/accounts/accounts.js
Patrick Newell
@pnewell4_twitter
Feb 08 2018 19:56
@AndrijWilhite I haven't done this myself, but I think you can define your own method, then reassign the Meteor method
Meteor.methods({
  "accounts/addressBookAdd": customAddressBookAdd
});
AndrijWilhite
@AndrijWilhite
Feb 08 2018 20:22
@pnewell4_twitter Thanks! ill give that I try after I squash this other issue I got started on
Scott Betzel
@Snaze
Feb 08 2018 20:56
hey all - does anyone know how I would disable (hide) the top & right toolbars?