browserify / browserify/node-util

circular reference cause `inherits()` became empty object

Offen Anfängerfreundlich
#80 6 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
255
Forks
92
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

the line below refs to `inherits()` from `inherits` module, but `inherits` module reference back to `util` module by checking the implementation on `util` module first, causing the first `require('inherits')` to returns empty object (default exports is empty object), if then `util.inherits()` gets call immediately it will throw.

problematic line in question:
https://github.com/browserify/node-util/blame/ef984721db7150f651800e051de4314c9517d42c/util.js#L592

the line needs to be updated to `require('inherits/inherits_browser')`

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start at util.js line 592, linked in the issue, and inspect the circular require involving inherits and util. Update the referenced module path as specified, then verify that requiring util and calling util.inherits no longer encounters an empty export during initialization.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, nodejs
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.