1egoman / 1egoman/debundle

Debundler V2. Weird error

Offen
#32 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
737
Forks
141
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I know @1egoman most likely won't update this project anymore (debundle v2), but if someone can help then please:

I installed the project, changed directory to it and ran `npm install` it installed some packages and once i tested it with this command: `node src/index.js bundle.js` it gave me this error (full log):
```
PS D:\Downloads\debundle-2\debundle-2> node src/index.js bundle.js
[LOG] Read bundle D:\Downloads\debundle-2\debundle-2\bundle.js (1721650 bytes)
[LOG] Looking for webpackBootstrap in bundle...
[LOG] Found webpackBootstrap!
[LOG] webpackBootstrap module call expression: __webpack_modules__[moduleId].call(module.exports, module, module.exports
, __webpack_require__)
D:\Downloads\debundle-2\debundle-2\node_modules\escope\lib\referencer.js:226
this.currentScope().__define(node.id, new _definition.Definition(_variable2.default.FunctionName, node.i
d, node, null, null, null));
^

TypeError: Cannot read properties of null (reading '__define')
at Referencer.visitFunction (D:\Downloads\debundle-2\debundle-2\node_modules\escope\lib\referencer.js:226:36)
at Referencer.FunctionDeclaration (D:\Downloads\debundle-2\debundle-2\node_modules\escope\lib\referencer.js:564:18)
at Visitor.visit (D:\Downloads\debundle-2\debundle-2\node_modules\esrecurse\esrecurse.js:104:34)
at Object.analyze (D:\Downloads\debundle-2\debundle-2\node_modules\escope\lib\index.js:153:16)
at new WebpackBootstrap (D:\Downloads\debundle-2\debundle-2\src\subcomponents\WebpackBootstrap.js:9:32)
at Bundle._findWebpackBootstrap (D:\Downloads\debundle-2\debundle-2\src\subcomponents\Bundle.js:247:29)
at Bundle.parse (D:\Downloads\debundle-2\debundle-2\src\subcomponents\Bundle.js:78:10)
at Object. (D:\Downloads\debundle-2\debundle-2\src\index.js:38:8)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)

Node.js v20.16.0
```
which I think is releated to referencer.js and not to this project, so can anyone help?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

The error occurs in escope's referencer.js when processing a webpack bundle. Start by examining src/subcomponents/WebpackBootstrap.js line 9 and src/subcomponents/Bundle.js lines 247 and 78 to see how the bundle is parsed. Check the bundle.js input file for any unusual function declarations that might cause escope to fail. Look into the escope library version and its compatibility with Node v20.16.0. Running the failing command with debug logs might reveal the problematic AST node.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, nodejs, webpack
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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