ionic-team / ionic-team/rollup-plugin-node-polyfills
Commonjs + lodash breaks: Modules with 'syntheticNamedExports' need a default export.
- 主要言語
- JavaScript
- スター
- 142
- フォーク
- 65
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
### How Do We Reproduce?
https://repl.it/repls/StainedOrchidUserinterface
### Expected Behavior
It should build correctly.
### Actual Behavior
Without `transformMixedEsModules: true` in `commonjs()` config, this happens in the browser:
```
ReferenceError: module is not defined_freeGlobal.js:4
Lodash
InnerModuleEvaluation self-hosted:1572
evaluation self-hosted:1543
```
Turning that option on exposes this error:
```
[!] Error: Modules with 'syntheticNamedExports' need a default export.
node_modules/lodash/_freeGlobal.js
Error: Modules with 'syntheticNamedExports' need a default export.
at error (/home/runner/StainedOrchidUserinterface/node_modules/rollup/dist/sha
red/rollup.js:161:30)
at Module.getDefaultExport (/home/runner/StainedOrchidUserinterface/node_modul
es/rollup/dist/shared/rollup.js:15151:20)
at Module.getVariableForExportName (/home/runner/StainedOrchidUserinterface/no
de_modules/rollup/dist/shared/rollup.js:15311:48)
at Module.getDefaultExport (/home/runner/StainedOrchidUserinterface/node_modul
es/rollup/dist/shared/rollup.js:15148:39)
at NamespaceVariable.renderBlock (/home/runner/StainedOrchidUserinterface/node
_modules/rollup/dist/shared/rollup.js:10437:49)
at Chunk$1.preRender (/home/runner/StainedOrchidUserinterface/node_modules/rol
lup/dist/shared/rollup.js:16444:48)
at generate (/home/runner/StainedOrchidUserinterface/node_modules/rollup/dist/
shared/rollup.js:18884:23)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 0)
at async build (/home/runner/StainedOrchidUserinterface/node_modules/rollup/di
st/bin/rollup:1466:5)
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start with the linked REPL and the commonjs() configuration, comparing builds with and without transformMixedEsModules. Inspect how node_modules/lodash/_freeGlobal.js is handled when syntheticNamedExports is enabled, then verify that the reproduction builds successfully and no browser module error remains.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, rollup
- 領域
- build-system, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100