Closed
Description
What happens and why it is wrong
Environment
- Yarn 3
Versions
The command to use envinfo
throws an error, so I'm resorting to copy-paste. All versions are latest.
"rollup": "^2.75.5",
"rollup-plugin-typescript2": "^0.32.0",
"typescript": "^4.7.2"
The error resides here:
if (typeof commonjsRequire === "function") {
try {
lodash = {
clone: require("lodash/clone"),
constant: require("lodash/constant"),
each: require("lodash/each"),
filter: require("lodash/filter"),
has: require("lodash/has"),
isArray: require("lodash/isArray"),
isEmpty: require("lodash/isEmpty"),
isFunction: require("lodash/isFunction"),
isUndefined: require("lodash/isUndefined"),
keys: require("lodash/keys"),
map: require("lodash/map"),
reduce: require("lodash/reduce"),
size: require("lodash/size"),
transform: require("lodash/transform"),
union: require("lodash/union"),
values: require("lodash/values")
};
} catch (e) {
// continue regardless of error
}
}
if (!lodash) {
lodash = window._;
}
The line saying to use window._
throws an error because window
does not exist in the Node environment.
This is newly introduced in 0.32.0. Reverting to 0.31.0 fixes this.