Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependencies #91

Open
acoreyj opened this issue May 29, 2018 · 4 comments
Open

Circular dependencies #91

acoreyj opened this issue May 29, 2018 · 4 comments

Comments

@acoreyj
Copy link

acoreyj commented May 29, 2018

These prevent at least Rollup from compiling for web in a way that works

Circular dependency: node_modules/msgpack-lite/lib/bufferish.js -> node_modules/msgpack-lite/lib/bufferish-array.js -> node_modules/msgpack-lite/lib/bufferish.js
Circular dependency: node_modules/msgpack-lite/lib/bufferish.js -> node_modules/msgpack-lite/lib/bufferish-array.js -> commonjs-proxy:/Users/Corey/Documents/workspace/mkr/node_modules/msgpack-lite/lib/bufferish.js -> node_modules/msgpack-lite/lib/bufferish.js
Circular dependency: node_modules/msgpack-lite/lib/bufferish.js -> node_modules/msgpack-lite/lib/bufferish-buffer.js -> node_modules/msgpack-lite/lib/bufferish.js
Circular dependency: node_modules/msgpack-lite/lib/bufferish.js -> node_modules/msgpack-lite/lib/bufferish-uint8array.js -> node_modules/msgpack-lite/lib/bufferish.js
Circular dependency: node_modules/msgpack-lite/lib/bufferish.js -> node_modules/msgpack-lite/lib/bufferish-proto.js -> node_modules/msgpack-lite/lib/bufferish.js
Circular dependency: node_modules/msgpack-lite/lib/encode.js -> node_modules/msgpack-lite/lib/encode-buffer.js -> node_modules/msgpack-lite/lib/write-core.js -> node_modules/msgpack-lite/lib/ext-packer.js -> node_modules/msgpack-lite/lib/encode.js
Circular dependency: node_modules/msgpack-lite/lib/encode.js -> node_modules/msgpack-lite/lib/encode-buffer.js -> node_modules/msgpack-lite/lib/write-core.js -> node_modules/msgpack-lite/lib/ext-packer.js -> commonjs-proxy:/Users/Corey/Documents/workspace/mkr/node_modules/msgpack-lite/lib/encode.js -> node_modules/msgpack-lite/lib/encode.js
Circular dependency: node_modules/msgpack-lite/lib/decode.js -> node_modules/msgpack-lite/lib/decode-buffer.js -> node_modules/msgpack-lite/lib/read-core.js -> node_modules/msgpack-lite/lib/ext-unpacker.js -> node_modules/msgpack-lite/lib/decode.js
Circular dependency: node_modules/msgpack-lite/lib/decode.js -> node_modules/msgpack-lite/lib/decode-buffer.js -> node_modules/msgpack-lite/lib/read-core.js -> node_modules/msgpack-lite/lib/ext-unpacker.js -> commonjs-proxy:/Users/Corey/Documents/workspace/mkr/node_modules/msgpack-lite/lib/decode.js -> node_modules/msgpack-lite/lib/decode.js

@kawanet
Copy link
Owner

kawanet commented May 29, 2018

@acoreyj
Let me know the command to reproduce the message above.

I have never faced the problem on compiling it with browserify though.

@acoreyj
Copy link
Author

acoreyj commented May 29, 2018

@kawanet

I don't have a simple reproduction setup. Basically if you compile a project with rollup you will see this printout. You can see more about it here and here.

I'm using rollup to build a bundle that requires fortune-indexeddb which requires msgpack-lite.

Yup it does work with browserify, what I ended up doing is creating a browserify bundle of fortune-indexeddb and include that. This may be more of an issue of fortune-indexeddb not including a bundled distribution.

Not sure what would be for you to do other than switching everything to javascript modules.

Although is there a reason that your browser field in the package.json doesn't just point to the bundle in dist?

@kawanet
Copy link
Owner

kawanet commented May 29, 2018

Although is there a reason that your browser field in the package.json doesn't just point to the bundle in dist?

No reason but just missing, I guess.

@pkit
Copy link

pkit commented Feb 6, 2020

It's simple:

// bufferish-array.js
var Bufferish = require("./bufferish");
// bufferish.js
var BufferArray = exports.Array = require("./bufferish-array");

Here's the circle. Pretty nasty one.
Refactoring out all the stuff like var isArray = exports.isArray = require("isarray"); into bufferish-utils.js will probably fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants