Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Using { useBuiltIns: usage } causes circular dependencies #254

@timdp

Description

@timdp

If I change my preset-env config from the default { useBuiltIns: false } to 'usage', I get tons of circular dependency warnings from Rollup, e.g.,

Circular dependency: ../../node_modules/core-js/modules/_export.js -> ../../node_modules/core-js/modules/es6.function.name.js -> ../../node_modules/core-js/modules/es6.regexp.match.js -> ../../node_modules/core-js/modules/es6.regexp.constructor.js -> ../../node_modules/core-js/modules/_inherit-if-required.js -> ../../node_modules/core-js/modules/_set-proto.js -> ../../node_modules/core-js/modules/es6.object.set-prototype-of.js -> ../../node_modules/core-js/modules/_export.js

And then my bundle crashes on this statement in core-js:

_export(_export.S, "Object", {
  setPrototypeOf: _setProto.set
});

where _export is undefined. So that looks a lot like the circular dependency hadn't been populated yet upon the call to it. If I comment out that statement, it just crashes on the next occurrence of _export.

The question is, of course, what causes the circular dependency to be introduced. One possibility is that the core-js code itself is getting run through Babel somehow.

I'm using the latest versions of node-resolve, commonjs, and babel (+ preset-env), in that order.

In #250, you recommend trying the beta version, but unfortunately, I get the same behavior with v4.1.0-0.

I realize this is not necessarily an issue with this plugin, but unfortunately, it's really hard for me to debug it outside of Rollup. Any input you might have is appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions