These are chat archives for reactioncommerce/reaction

18th
Feb 2019
rlamostre0
@rlamostre0
Feb 18 07:31
hi @loan-laux do you have other flags when running docker build?

@loan-laux if I follow the documentation;
docker build --build-arg TOOL_NODE_FLAGS="--max-old-space-size=2048" -t mycustom .

is this enough?

@loan-laux running the built image on production server, the page loads up more than 30seconds to a minute
Loan Laux
@loan-laux
Feb 18 07:34
I'd increase the RAM allocation to 4GB minimum @rlamostre0. 6 is comfortable and is wha I use.
Which page are you talking about? @rlamostre0
rlamostre0
@rlamostre0
Feb 18 07:34
homepage itself @loan-laux
Loan Laux
@loan-laux
Feb 18 07:34
On the Next starter-kit or on the legacy storefront?
rlamostre0
@rlamostre0
Feb 18 07:35
legacy store(meteor) @loan-laux
also, we've managed to deploy it on kubernetes
though the page load takes long to load
I don't know about increasing the ram, but each server node has 8gb ram already @loan-laux
Loan Laux
@loan-laux
Feb 18 07:39
Sorry, I'm confused about this TOOL_NODE_FLAGS argument on build since I don't use it. Thought it was for the RAM allocation during build time. In any way, I've never had to use it.
Adrian1110
@Adrian1110
Feb 18 07:40
@bradlead Yes I manage to fix the issue. In my case there was some problems with one docker(doesn't have permission to write and because of that failed to start).
Loan Laux
@loan-laux
Feb 18 07:40
@rlamostre0 You shouldn't use the legacy storefront. It's not supported anymore and its performance is — as you saw — less than stellar. I would highly suggest moving to the Next.js starter-kit, which features SSR by default and is way lighter.
Adrian1110
@Adrian1110
Feb 18 08:50
@loan-laux I have added an private and public key for Stripe payments and when I try to make a payment I received an error message "undefined is not iterable"
Do you have any idea way?
image.png
abhisheknair-clarion
@abhisheknair-clarion
Feb 18 09:02
How compatible is reaction 13 with reaction 2.0, Does it still use meteor?
Loan Laux
@loan-laux
Feb 18 10:05
No idea, never seen that before @Adrian1110
Bün Çolak
@BunColak
Feb 18 10:06
@loan-laux how do we set the default user group for signed users? I see that right now they appear as 'Guest'
Loan Laux
@loan-laux
Feb 18 10:06
@abhisheknair-clarion Reaction 2.0 still uses Meteor. There's a lot that changed from 1.3 but the upgrade should be doable if you go version by version, inspecting changelogs carefully.
@BunColak I would use the onCreateUser hook and the setUserPermissions function (available at /imports/plugins/core/accounts/server/methods/setUserPermissions.js).
Bün Çolak
@BunColak
Feb 18 10:08
Thx :)
Loan Laux
@loan-laux
Feb 18 10:09
Basically, use that hook to add your set of custom permissions every time a new account in created. Should be pretty straightforward.
Isha Saran
@ishasaran
Feb 18 10:18
@here do we need to necessarily have some configuration when creating any kind of plugin which has server code too? I made a payment plugin the no-meteor side and then had a custom component for the payment action on the starterkit storefront. But I keep getting this, when finally placing the order.
reaction_1  | 10:15:14.648Z ERROR Reaction:
reaction_1  |   Error emitting afterOrderCreate Error: Configuration not found for abc payment method. Did you remove the plugin that provides this payment method?
reaction_1  |       at getPaymentMethodConfigByName (imports/plugins/core/core/server/no-meteor/pluginRegistration.js:19:11)
reaction_1  |       at MethodInvocation.listRefunds (imports/plugins/core/orders/server/methods/listRefunds.js:30:39)
reaction_1  |       at currentArgumentChecker.withValue (packages/check/match.js:118:15)
reaction_1  |       at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
reaction_1  |       at Object._failIfArgumentsAreNotAllChecked (packages/check/match.js:116:43)
reaction_1  |       at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1764:18)
reaction_1  |       at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:1685:15)
reaction_1  |       at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
reaction_1  |       at resolve (packages/ddp-server/livedata_server.js:1683:36)
reaction_1  |       at new Promise (<anonymous>)
reaction_1  |       at Server.applyAsync (packages/ddp-server/livedata_server.js:1682:12)
reaction_1  |       at Server.apply (packages/ddp-server/livedata_server.js:1621:26)
reaction_1  |       at Server.call (packages/ddp-server/livedata_server.js:1603:17)
reaction_1  |       at sendOrderEmail (imports/plugins/core/orders/server/util/sendOrderEmail.js:117:31)
reaction_1  |       at appEvents.on.order (imports/plugins/core/orders/server/startup.js:46:43)
reaction_1  |       at Promise.asyncApply (imports/node-app/core/util/appEvents.js:19:9)
reaction_1  |    => awaited here:
reaction_1  |       at Promise.await (/home/node/.meteor/packages/promise/.0.11.1.lt6vo5.rl7ft++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:60:12)
reaction_1  |       at Server.apply (packages/ddp-server/livedata_server.js:1634:14)
reaction_1  |       at Server.call (packages/ddp-server/livedata_server.js:1603:17)
reaction_1  |       at sendOrderEmail (imports/plugins/core/orders/server/util/sendOrderEmail.js:117:31)
reaction_1  |       at appEvents.on.order (imports/plugins/core/orders/server/startup.js:46:43)
reaction_1  |       at Promise.asyncApply (imports/node-app/core/util/appEvents.js:19:9)
reaction_1  |       at /home/node/.meteor/packages/promise/.0.11.1.lt6vo5.rl7ft++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
reaction_1  |    => awaited here:
reaction_1  |       at Function.Promise.await (/home/node/.meteor/packages/promise/.0.11.1.lt6vo5.rl7ft++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)
reaction_1  |       at Promise.asyncApply (imports/node-app/core/util/appEvents.js:35:5)
reaction_1  |       at /home/node/.meteor/packages/promise/.0.11.1.lt6vo5.rl7ft++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
reaction_1  | 10:15:18.825Z ERROR Reaction:  (errorId=cjsa6os2x00007gquupv9jmm2)
reaction_1  |   path: [
reaction_1  |     "order"
reaction_1  |   ]
Muhammad Adil
@adilsaeed31
Feb 18 10:19
@ishasaran You need to define configuration for your payment method.
Isha Saran
@ishasaran
Feb 18 10:20
Hey @adilsaeed31 I'm not sure I understand that
Muhammad Adil
@adilsaeed31
Feb 18 10:21
@ishasaran check your payment method is properly registered or not in Reaction.
Loan Laux
@loan-laux
Feb 18 10:26
@ishasaran Do you have a paymentMethods array in your plugin's register.js?
Isha Saran
@ishasaran
Feb 18 10:32
So yes I don't have that, because I'm just using the starterkit storefront for actually allowing orders etc
should it be an empty array otherwise?
I'm trying with an empty array - reaction server is restarting ..... 2 mins waiting time - :P
Loan Laux
@loan-laux
Feb 18 10:35

Hmm, but I believe you should have some kind of server-side verifications for that, especially for something as critical as a payment method.

If it's just for a test, copy-paste the array that's in the example in the corresponding doc article, and just put empty anon functions for capturePayment and such https://docs.reactioncommerce.com/docs/how-to-create-a-payment-provider#registration

Adrian1110
@Adrian1110
Feb 18 10:36
@loan-laux is bug? should I report this on github?
Loan Laux
@loan-laux
Feb 18 10:36
Or simply do a console.log for the sake of logging something.
paymentMethods: [{
    name: "stripe_card",
    displayName: "Stripe Card",
    canRefund: true,
    functions: {
      capturePayment: () => console.log("capturePayment"),
      createAuthorizedPayment: () => console.log("capturePayment"),
      createRefund: () => console.log("capturePayment"),
      listRefunds: () => console.log("capturePayment")
    }
  }],
Didn't mean to say capturePayment all the way but you get the point @ishasaran
@Adrian1110 Can you try with a five digit zip code? Do you get anything in the server console?
Isha Saran
@ishasaran
Feb 18 10:38
I get it, thank you for that. Lemme try
Adrian1110
@Adrian1110
Feb 18 10:40
@loan-laux nothing goes wrong on server side console. With five digit zip code the result is the same
abhisheknair-clarion
@abhisheknair-clarion
Feb 18 10:55
@loan-laux Thanks
Loan Laux
@loan-laux
Feb 18 10:55
@Adrian1110 Anything strange in Stripe logs? Anything at all?
Muhammad Adil
@adilsaeed31
Feb 18 12:43
.
Eliot Hills
@elhil
Feb 18 16:08
hey folks, I’ve searched around for an answer to this but to no avail.. is there an officially recommended architecture for new projects? the docs seem pretty fragmented - I was following the plugin tutorial and liked the idea of expressing customizations as custom plugins, but then the tutorial for customizing the Product page links to the reaction-next-starterkit documentation, which is a completely different approach, architecturally 🤔 anyone know what the maintainers recommend as of right now?
Loan Laux
@loan-laux
Feb 18 17:18
@elhil It is a bit confusing for beginners indeed. Right now, you should use the reaction-next-starterkit (or a GraphQL storefront made from scratch) for anything customer-facing. The Meteor storefront is deprecated and stays around just for admin stuff.
Eliot Hills
@elhil
Feb 18 17:21
@loan-laux thanks for the tip! it’s labeled “not ready for production” - any idea when that will change? I’d rather develop on a stable version if it’s unknown when 2.0 will be stable, thought it sounds like anything I develop on the old storefront is legacy-by-default :sweat_smile:
Loan Laux
@loan-laux
Feb 18 17:23
Indeed, you'll have to rewrite anything developped on the Meteor storefront. The Nexy.js starter-kit is labeled as such because it's still in Release Candidate, but the stable version will be released very soon (I believe in 2 months maximum but the core teams needs to confirm).
Eliot Hills
@elhil
Feb 18 17:26
fantastic, thanks for taking the time :beers:
Philipp Laurim
@EdgarNigel
Feb 18 19:06
hey all, I try to follow the starter kit tutorial. Set up the custom homepage as shown in the docs. routing works fine, however the class based styling you set in the example code for the new homepage component doesn’t seem to work. Either they are overwritten by the theme files or the classname doesn’t get rendered correctly. Is there a best practice for styling in the starter kit? Would love to style within each component.