-
The error occurs in the following part of the code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @fof3096 , thanks for reaching out to us. This issue is fixed with a named import with version 2.0.1, like so: import { MercadoPago } from "mercadopago";
const client = new MercadoPago({
accessToken: "ACCESS_TOKEN",
}); |
Beta Was this translation helpful? Give feedback.
-
Good afternoon @fof3096! import MercadoPago from 'MercadoPago'
...
const client = new MercadoPago.default({
accessToken: process.env.MERCADO_PAGO_ACCESS_TOKEN,
}); This happens because the bundle is built and delivered using commonjs. Or to import in a named way, you must use the module is called import { MercadoPagoConfig } from 'MercadoPago'
...
const client = new MercadoPagoConfig({
accessToken: process.env.MERCADO_PAGO_ACCESS_TOKEN,
}); This way it is not necessary to add Lucas. |
Beta Was this translation helpful? Give feedback.
Good afternoon @fof3096!
There really was an innocence to the examples added on github, for vanilla javascript integration.
To create your integration correctly with javascript, it is necessary to add the
.default
at the end of MercadoPagoEg.
This happens because the bundle is built and delivered using commonjs.
Or to import in a named way, you must use the module is called
MercadoPagoConfig
Eg.
This wa…