Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Events API polyfilled badly?

オープン
#16 コメント 1 件 リアクション 7 件 担当者 0 名 GitHub で見る

@robertsLando がすでに取り組んでいます。

2022年8月9日 から。

  • #44 @robertsLando による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, rollup

調査の方向性

まず、async-mqtt と rollup-plugin-node-polyfills による events モジュールの処理を使って Snowpack のビルドを再現します。生成された events バインディングを調べ、パッケージでの class Parser extends events の使用方法と比較します。報告されているコンストラクターエラーなしで polyfill された events の値を拡張できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hey there,

I am using Snowpack to deal with dependencies. I am aware that Snowpack uses rollup-plugin-node-polyfills to polyfill Node built-in modules. I'd like to use a package called async-mqtt which relies on node built-in modules (events, stream, buffer). So I installed it with Snowpack, and polyfilled it with this plugin. However, I noticed that the polyfilling process did something strange. I got an error: Class extends value [object Object] is not a constructor or null

Now, this error applies for the following code: class Parser extends events. So I checked what is the value of events, and it turns out, that events is an object instead of a class:

var events = /*#__PURE__*/Object.freeze({
  __proto__: null,
  'default': EventEmitter,
  EventEmitter: EventEmitter
});

Obviously, you cannot extend a class from an object like this. How can I resolve this issue?
Thanks.

主要言語
JavaScript
スター
142
フォーク
64
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/rollup-plugin-node-polyfills のほかの issue

ionic-team/rollup-plugin-node-polyfills の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。