-
-
Notifications
You must be signed in to change notification settings - Fork 781
Description
System Info
macOS or linux
rspack/core
any browser, this is target for node
Details
There exists a known issue in any package that depends on formidable 1.x where it expects some global to be set for production bundling. We happen to be using superagent v3.x transitively in our node_modules, and that depends on formidable 1.x. In webpack, it will ignore the require as it can't be statically analyzed so it still completes the production build. However, rspack fails with
ERROR in × JavaScript parsing error: Invalid assignment target
╭─[6839:19]
6837 │ }),
6838 │ "2666": (function (module, __unused_webpack_exports, __webpack_require__) {
6839 │ if (global.GENTLY) __webpack_require__(145) = GENTLY.hijack(__webpack_require__(145));
· ────────────────────────
6840 │
6841 │ var util = __webpack_require__(3837),
╰────
ERROR in × JavaScript parsing error: The left-hand side of an assignment expression must be a variable or a property access.
╭─[6839:19]
6837 │ }),
6838 │ "2666": (function (module, __unused_webpack_exports, __webpack_require__) {
6839 │ if (global.GENTLY) __webpack_require__(145) = GENTLY.hijack(__webpack_require__(145));
· ────────────────────────
6840 │
6841 │ var util = __webpack_require__(3837),
This should contain parity with webpack even if it is technically wrong.
Reproduce link
https://github.com/Aghassi/rspack-node-app-production-bundle-bug
Reproduce Steps
- Clone repo
- pnpm i
- pnpm run build:rspack
- See failure
- pnpm run build:webpack
- See success with warnings
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels