-
Notifications
You must be signed in to change notification settings - Fork 43
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
Uncaught (in promise) TypeError: Class constructor Gossipsub cannot be invoked without 'new' #323
Comments
It works fine with release 0.13.1, so something went wrong from 0.14.0. |
@TheBojda Thanks for the report! Can you try 0.14.1 please? |
Yes. It throws the error with 0.14.1. |
ok thanks, will investigate. |
I am not able to reproduce the issue. You do mention that you are using a JS file but you are getting a TypeError. Are you using TypeScript? If so, can you share your ts.config please? Reproduction:
import 'regenerator-runtime/runtime.js'
import { Waku } from "js-waku";
async function init() {
await Waku.create({ bootstrap: true });
}
init();
{
"name": "323-class-constructor-gossip",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"js-waku": "^0.14.1",
"regenerator-runtime": "^0.13.9"
}
} |
Hi! I've used parcel. This is my packages.json:
index.html:
index.js:
When you start it with npm start or parcel index.html. It throws the error in the browser. I forgot to mention that I'm using it from a browser. :) |
Thanks, I haven't tried parcel so I'll have to investigate. It should work in the browser as we have several examples that uses React TS and React JS or even Vanilla JS: https://github.com/status-im/js-waku/tree/main/examples I am guessing the issue is with parcel default config. |
I've downloaded min-js-web-chat and changed the js-waku dependency:
It throws the same error. So, something is wrong with the package in the npm registry, not a Parcel related problem. You should publish it a different way or something. :) Until it, I can use 0.13.1. |
Thank you for the investigation. Will review. |
@TheBojda can you let me know if 0.14.2-rc.0 fixes the issue? thanks! |
Yay. Works like a charm. Ty :) |
Excellent, now released with 0.14.2. |
Problem
I've installed waku through npm (npm install js-waku), and the below minimal js throws the "Uncaught (in promise) TypeError: Class constructor Gossipsub cannot be invoked without 'new'" error.
This is my JS file:
import 'regenerator-runtime/runtime'
import { Waku } from "js-waku";
async function init() {
await Waku.create({ bootstrap: true });
}
init();
The text was updated successfully, but these errors were encountered: