#Off_set
1 messages · Page 1 of 1 (latest)
so whenever I put this line in my code, the payment page just goes blank
What are you trying to do? What error message do you see?
Are you following this guide? https://stripe.com/docs/stripe-js/react#elements-provider
The above error occurred in the <Elements> component: i see this
yea its the same except my <Elements> is in <Route>
What's the full error message?
The above error occurred in the <Elements> component:
at Elements (http://localhost:3000/static/js/bundle.js:149049:30)
at RenderedRoute (http://localhost:3000/static/js/bundle.js:95751:5)
at Routes (http://localhost:3000/static/js/bundle.js:96215:5)
at Router (http://localhost:3000/static/js/bundle.js:96146:15)
at BrowserRouter (http://localhost:3000/static/js/bundle.js:94316:5)
at App
at StateProvider (http://localhost:3000/static/js/bundle.js:2512:5)
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
well
Sorry for the delay.
Is that the full error message?
Can you try to simply your code by removing your Route and only trying <Elements stripe={promise}><Payment /></Elements> to see if it works (and if not what error you see)?
Uncaught Error: [Elements] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment> i see this error
Well this just means you are using both <Route> and <Elements> in <Routes>, which is not possible.
oh my bad, is there different approach?
Could you completely remove the routes for now, just to test this code? <Elements stripe={promise}><Payment /></Elements>
Hello, apologies but I just caught up on this thread. Are you saying that that would be difficult to remove for a quick test or are you saying it wouldn't be possible to remove this and have your site still work?