calvinmetcalf / rollup-plugin-node-builtins

138 stars 40 forks source link

When compiled, shows warnings: Circular dependency #39

Open francoisromain opened 6 years ago

francoisromain commented 6 years ago

Hello,

When compiled, Rollup shows some warnings:

(!) Circular dependency: node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/readable.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js
(!) Circular dependency: node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/writable.js -> node_modules/rollup-plugin-node-builtins/src/es6/readable-stream/duplex.js

Is is a problem?

calvinmetcalf commented 6 years ago

shouldn't be one

juanjoDiaz commented 6 years ago

I'm seeing the same. It would be great to get rid of the warning.

linusschwalbe commented 6 years ago

I do believe the circular problem stems from how Nodes stream is constructed. Though it would be preferable to be able to supres this specific warning in the plugin.

kopax commented 6 years ago

I have the same warning

nicobrinkkemper commented 6 years ago

Did any of you solve this yet? I've got the same issue.

ydaniv commented 6 years ago

Changing order of plugins around causes this to appear/disappear. Moving node-resolve and commonjs before node-globals and node-builtins in the order of plugins causes it to appear, and vice versa it disappears, but then moduleContext doesn't work properly.

calvinmetcalf commented 6 years ago

folks as far as I know this is only a warning and not an error so my official position is 'don't worry about it'

the actual reason for it is because duplex streams inherit from both readable and writable streams but for various reasons both readable and writable streams need access to Duplex to check if the instance they are operating on is descended from a duplex or not (for reasons that really seamed good at the time) but is done here in a way that works fine for es6 module rules so probably isn't something to worry about

orar commented 5 years ago

I get same with htmparser2. Its not just a warning. I get the following error afterwards when running

var DomHandler$1 = lib.DomHandler,
                               ^
TypeError: Cannot read property 'DomHandler' of undefined
barry800414 commented 5 years ago

I have the same warning and got same errors as @orar while running :(

fabien-h commented 5 years ago

Same warning here.

When I switch the order to have 'node-resolve' first, I get this error :

`An error occurred while building your code: TypeError: Cannot read property 'warn' of undefined. And the code does not compile.

fabien-h commented 5 years ago

Probably linked to this :

https://github.com/rollup/rollup-plugin-commonjs/issues/248

This is an internal issue with the custom stream implementation.