Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error After Instantiating Infusionsoft #10

Open
SSICWeb opened this issue Feb 25, 2022 · 2 comments
Open

Error After Instantiating Infusionsoft #10

SSICWeb opened this issue Feb 25, 2022 · 2 comments

Comments

@SSICWeb
Copy link

SSICWeb commented Feb 25, 2022

Hello,

I receive the below error after instantiating DataContext with my Infusionsoft token.

const infusionsoft = new api.DataContext(${infusionAccessToken});

This works correctly when I use the no longer maintained infusionsoft-api library. I'm importing the library rather than using require because it is not defined in my ES module scope (this may not have any bearing on the issue).

Do you have any ideas? It's really odd as I'm not doing anything out of the norm and it works with the older library. The older library is returning an error when returning a promise, but you can access the API.

Console error:

\node_modules\infusionsoft-javascript-api\lib\Queryable.js:10
.class('Queryable') .define({
^

TypeError: require(...).class is not a function
at Object. (C:\Users\steve\projects\mos\node_modules\infusionsoft-javascript-api\lib\Queryable.js:10:7)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Users\steve\projects\mos\node_modules\infusionsoft-javascript-api\lib\DataContext.js:1:17)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

@SSICWeb
Copy link
Author

SSICWeb commented Feb 25, 2022

When using ContactService with the old library it returns a promise:

Infusionsoft Data Context: Promise {
promiseDispatch: [Function (anonymous)],
valueOf: [Function (anonymous)],
inspect: [Function (anonymous)]
}

However, when I try to return a result with .done(result => { console.log(result) }) it gives an error:

Error: getaddrinfo ENOTFOUND gkcx3ekkxtjacabqty0rgma2exgb.infusionsoft.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'gkcx3ekkxtjacabqty0rgma2exgb.infusionsoft.com'
}

I know you are not maintaining that library, but I wanted to show that it was partially working with my setup.

@mkalygin
Copy link

@SSICWeb this is caused by the typedef package upgrade in f90c0cf. Do npm install [email protected] and it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants