Error on import CardPayment #49
Closed
checomendoza
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
Hello, I've tried to create a NextJS project with Card Payment brick and it's working fine. That's my code: 'use client';
import { TCardPayment } from '@mercadopago/sdk-react/bricks/cardPayment/type';
import styles from './page.module.css'
import { initMercadoPago, CardPayment } from '@mercadopago/sdk-react'
initMercadoPago('YOUR-PUBLIC-KEY')
export default function Home() {
const setup: TCardPayment = {
onSubmit: async (formData) => console.log(formData),
initialization: {
amount: 1000
}
}
return (
<main className={styles.main}>
<div className={styles.brick}>
<CardPayment {...setup} />
</div>
</main>
)
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Unfortunaly, I have the same problem here. I tried to implement the "mercadopago/sdk-react" module to my already created Next app and it threw me the same error. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I created a small project in NEXTjs with CardPayment component, but when run dev enviroment, give this error
This is the code:
How I could resolve this error?
Beta Was this translation helpful? Give feedback.
All reactions