sendinblue / APIv3-nodejs-library

SendinBlue's API v3 Node.js Library
ISC License
102 stars 47 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'instance') #116

Closed krisztian-fekete closed 2 years ago

krisztian-fekete commented 2 years ago

Trying to add this with webpack to my project. Followed the installation instructions in the readme, added

parser: {
    amd: false
}

to my webpack.config.js. Created a js file and added

const SibApiV3Sdk = require('sib-api-v3-sdk');
let defaultClient = SibApiV3Sdk.ApiClient.instance;

Build finishes without errors, but I get `Uncaught TypeError: Cannot read properties of undefined (reading 'instance') when loading this file on a page.

krisztian-fekete commented 2 years ago

Might be a duplicate of https://github.com/sendinblue/APIv3-nodejs-library/issues/101

shubhamUpadhyayInBlue commented 2 years ago

Hi @krisztian-fekete Yes, it is a duplicate of #101. So, I am closing this one.

bcwin-i commented 1 year ago

Hi everyone, I was able to resolve this issue by changing the import. See changes below. import SibApiV3Sdk from '@sendinblue/client' to import * as SibApiV3Sdk from '@sendinblue/client'