Stripe integration broken?

The following code to create a stripe express account has suddenly stopped working. Any idea why?

const stripe = require (‘stripe’)( ‘sk_test_*********************************’ );

const account = await stripe.accounts.create({
type: ‘custom’ ,
country: ‘NZ’ ,
email: ‘jenny.jones@example.com’ ,
capabilities: {
card_payments: {requested: true },
transfers: {requested: true },
},
});
console.log( “Account :” + account);

The error message showing up in the developer console is :
Uncaught (in promise) Error: Cannot find module ‘http’
at s (wixCodeNamespacesAndElementorySupport.min.js:1)
at s (wixCodeNamespacesAndElementorySupport.min.js:1)
at s (_prelude.js:1)
at _prelude.js:1
at Object.40…/Error (StripeResource.js:3)
at s (_prelude.js:1)
at _prelude.js:1
at Object.47…/StripeResource (Accounts.js:5)
at s (_prelude.js:1)
at _prelude.js:1

Did you get this fixed? I’m also getting a Cannot find module ‘http’ whilst trying to use stripe

The issue went away on it’s own. I can confirm this is not a stripe problem, as I was able to successfully test their APIs standalone while the call from Wix failed.
I doubt this is caused due to WIX’s never ending performance improvement rollout where they keep breaking something or the other.
Good luck.

Strange. As soon as I add the line

import { Stripe } from “stripe” ;

to frontend js I get the error Cannot find module ‘http’

i can load stripe in backend without issue

have you tried ‘require’ instead of import?
like so:-
const stripe = require(‘stripe’)(‘sk_test_your test key’);