Closed TopCodeBeast closed 2 years ago
The API emit is only internal, ie. it is there to emit events originating from the API.
I think if the parser can't parse # symbol?
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields for private field syntax.
it's not #parse error , I tried super() "The API emit is only internal, ie. it is there to emit events originating from the API." Cloud you tell me in detail?
My comment was applicable to your (now edited) post where you said you call .emit(message, payload)
l did not find the solution. It's not parse # symbol error, and I found in polkadot/api/base/event.js is changed to #eventemitter = new EventEmitter(); on version 7.5
It was changed to #eventemitter
in 2020, see this PR with the specific line - https://github.com/polkadot-js/api/pull/1921/files#diff-c2509fbc77b421e64bcdb8df56a4b5f06a093d511d305a4b5eda99c4173eb00eR10 (as per the git blame for the specific file)
Assuming it is private fields the best I can suggest is searching google for "private fields with bundler" (where <bundler>
is your specific bundler, e.g. webpack
, parcel
, etc.).
For instance here is a WP4 project that bundles the API 7.5.1 properly (via babel + browserslist in package.json to enable the env plugin to do it's job) https://github.com/jacogr/api-test-4500-wp4 and here is one that does the same in WP5 https://github.com/jacogr/api-test-4500
cloud you tell me about vue-webpack 4 to solve that error?
thanks I fixed
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
Currently, I updated polkadot/api 7.5+ and I get EventEmitter not found I get error here : #eventemitter = new EventEmitter(); I saw the event method is changed.
Cloud you help me?