#shainanand
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- shainanand, 1 day ago, 22 messages
- shainanand, 1 day ago, 15 messages
Uncaught ReferenceError: require is not defined
window._ = require("lodash");
Can you share a documentation link for the feature you're implementing?
Ok, and what does your code look like?
import {loadConnectAndInitialize} from '@stripe/connect-js';
const stripeConnectInstance = loadConnectAndInitialize({
// This is your test publishable API key.
publishableKey: "myPublishableKey",
fetchClientSecret: 'mySecret',
});
const accountOnboarding = stripeConnectInstance.create('account-onboarding');
accountOnboarding.setOnExit(() => {
console.log('User exited the onboarding flow');
});
container.appendChild(accountOnboarding);
Sounds like you're potentially mixing server/client code
in the documentation, it is suggesting to use server side code. But i tested it without server side function
To be clear this feature requires a sever component to generate the Account Session: https://stripe.com/docs/connect/get-started-connect-embedded-components#create-an-accountsession
yes, i have generated account session using the php code
then I used the generated clientSecret in the above js code
so i harcoded the values
This error specifically implies you're using require import statement in your client-side JS code