You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the yaml package, Collection and Pair are modules dependent on each other. Pair requires Collection and Collection requires Pair.
Expected Behavior
In the output, Collection is available in Pair.
Actual Behavior
In var Pair_1 = createCommonjsModule(function (module, exports) {,
there is var _Collection = interopRequireDefault(Collection_1$1); when Collection_1$1 is undefined.
var Collection_1$1 = createCommonjsModule(function (module, exports) {... is defined later.
At some point in the execution of code inside Pair_1, this statement someVar instanceof _Collection.default throws, because _Collection.default is undefined.
Thank you for your time!
The text was updated successfully, but these errors were encountered:
I think this is more an issue for rollup-plugin-commonjs than for Rollup core. The problem is that the current logic there does not work well for circuler references in commonjs modules. Unfortunately there is no easy fix, or to put it differently, there is a proposed solution by @guybedford but it will mean that tree-shaking will no longer work well for CommonJS code at the moment.
Still, I think at some point it would make sense to start implementing it, maybe in form of an alternative CJS plugin, and then later look at how we can get the tree-shaking up to speed here.
How Do We Reproduce?
Clone https://github.com/camille-hdl/rollup-yaml-bug and
follow the instructions in the readme (nothing weird: install, build, run)
In the yaml package,
Collection
andPair
are modules dependent on each other.Pair
requiresCollection
andCollection
requiresPair
.Expected Behavior
In the output,
Collection
is available inPair
.Actual Behavior
In
var Pair_1 = createCommonjsModule(function (module, exports) {
,there is
var _Collection = interopRequireDefault(Collection_1$1);
whenCollection_1$1
is undefined.var Collection_1$1 = createCommonjsModule(function (module, exports) {...
is defined later.At some point in the execution of code inside
Pair_1
, this statementsomeVar instanceof _Collection.default
throws, because_Collection.default
is undefined.Thank you for your time!
The text was updated successfully, but these errors were encountered: