-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
TypeError: Kitsu is not a constructor #103
Comments
Need some more information to investigate this:
|
Kitsu: 4.4.0 |
I can't seem to replicate this using node 6.10.2. Do you have a repository that has this issue I can test with? // example/test.js
const Kitsu = require('../lib/kitsu'); // same file as 4.4.0's 'kitsu' require
const api = new Kitsu({
baseURL: "http://localhost:3000/api/v1"
});
console.log(api) wopian@WOPCB:/mnt/c/github/kitsu$ nvm exec 6.10.2 node example/test
Running node v6.10.2 (npm v3.10.10)
Kitsu {
fetch: [Function],
update: [Function],
create: [Function],
camel: [Function: camel],
resCase: [Function: kebab],
plural: [Function: pluralize],
headers: [Object],
axios: { [Function: wrap] }
} |
Ah found the issue. The named export for the UMD files were the wrong casing. I.e, while the above code works fine in node itself, in the browser it was failing. If you did the following it would work: const kitsu = require('kitsu');
const api = new kitsu(...); I've now fixed this and will be released in |
|
Resolved in |
I'm getting this error while initializing with the following:
The text was updated successfully, but these errors were encountered: