Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

JS package exports an object instead of a class #1

Open
NikitaVlaznev opened this issue Nov 26, 2020 · 0 comments
Open

JS package exports an object instead of a class #1

NikitaVlaznev opened this issue Nov 26, 2020 · 0 comments

Comments

@NikitaVlaznev
Copy link

package.json contains the following:

"main": "dist/apiClient.js"

node_modules/sbermarket-api/dist/apiClient.js exports this:

exports.default = new ApiClient();

Thus node.js throws:
TypeError: sbermarketApi is not a constructor

when used like so:

const sbermarketApi = require("sbermarket-api").default;
const apiClient = new sbermarketApi(credentials);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant