roman-yerin/vertojs

TypeError: vertojs__WEBPACK_IMPORTED_MODULE_1__.Verto is not a constructor

gregoriusus opened this issue · 6 comments

If I use library from src everything is working, but if I use it from dist, I get this error... Can you please advise?

Can you provide me with a code you imported a library at?

I installed library via npm.

This is how I import it in code:
//import { Verto } from "../../../../../node_modules/vertojs/dist/index";
import {Verto} from 'vertojs';

Commented line is working, regular one doesn't. And it fails when initializing Verto:
var verto = new Verto({
transportConfig:{
login: "xxx",
passwd: "xxx",
socketUrl: "xxx"
},rtcConfig:{
iceServers: [{urls:"stun:stun.l.google.com:19302"}]
},
debug: true,
ice_timeout: 5000
})

Well... Do you have typescript support on the project? The default package entry point assumes you have. I will review the library code and defaults next days to make it more compatible to default user expectations.

Thank you for being active on this project. I am developing app in Angular, so typescript is supported.

I uninstalled npm and reinstall it. Now I do not have logout() and isLogged() functions in src/index.ts. I tried to download npm and open compressed file and this piece of code has gone. Something changed in npm?

Nothing changed when you asked.
I have just rebuilt the library, now you should be able to use it as described
import { Verto } from 'vertojs'