stripe-meteor icon indicating copy to clipboard operation
stripe-meteor copied to clipboard

ReferenceError: Stripe is not defined

Open richardgsands opened this issue 8 years ago • 9 comments

Hi,

I'm getting this error in the server console on startup. ReferenceError: Stripe is not defined at both/startup.js:2:3

Code snippet Meteor.startup(function() { Stripe.setPublishableKey('pk_test_etc'); // stripe test account });

Any ideas why this isn't working please? I've tried that code in both 'server' and 'both' folders in my Meteor project.

Many thanks, Richard.

richardgsands avatar Mar 23 '16 16:03 richardgsands

+1

ReferenceError: Stripe is not defined at server/start.js:9:3

EDIT: Just figured out how to stop the error, stripe isnt being defined on the server, but if you put a Meteor.startup(function(){ Stripe.setPublishableKey('KEY'); }

in a client folder, it doesnt set off any errors. havent tested past this.

Dreii avatar Mar 24 '16 01:03 Dreii

Stripe not defined using 1.3. +1

import {Stripe} from 'meteor/mrgalaxy:stripe' Meteor.startup(function() { Stripe.setPublishableKey("key"); });

zenonn37 avatar Mar 31 '16 17:03 zenonn37

I have the same issue on server side.

I have tried : import { StripeAPI } from 'meteor/mrgalaxy:stripe';

mlecoq avatar Apr 09 '16 15:04 mlecoq

Same issue while following the readme. Am running Meteor 1.2.1.

Meteor.startup(function () { Stripe.setPublishableKey('pk_test_...'); });

W20160411-11:04:02.624(-4)? (STDERR) /Users/pal/.meteor/packages/meteor-tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245 W20160411-11:04:02.624(-4)? (STDERR) throw(ex); W20160411-11:04:02.624(-4)? (STDERR) ^ W20160411-11:04:02.628(-4)? (STDERR) ReferenceError: Stripe is not defined W20160411-11:04:02.628(-4)? (STDERR) at server/startup/boot.js:25:1 W20160411-11:26:07.853(-4)? (STDERR) at /opt/meteor/.....boot.js

paolo-g avatar Apr 11 '16 15:04 paolo-g

Stripe is loaded by the client.

With meteor 1.3 you have just to add Stripe npm package (for server side) and import following script

for client side.

mlecoq avatar Apr 11 '16 16:04 mlecoq

I'm having the same issue with Meteor 1.2.1 - neither Stripe nor StripeCheckout are defined on the client...

demiters avatar May 25 '16 02:05 demiters

@mlecoq are you not using this package then? Do you just use the npm package instead?

chrise86 avatar Aug 04 '16 11:08 chrise86

@chrise86 yes, npm package is sufficient !

mlecoq avatar Aug 16 '16 13:08 mlecoq

I don't understand why this package is only client-side. It's not noticed anywhere, there is actually a Server chapter in the readme which doesn't tell to install any other dependencies. Couldn't you wrap the npm package (you can add npm dependencies). Please tell in the doc clearly if the package is not isomorphic and that one need to install a npm package for server-side.

ilan-schemoul avatar Sep 03 '16 01:09 ilan-schemoul