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 dependency #310

Closed
krassx opened this issue Sep 8, 2016 · 11 comments
Closed

Circular dependency #310

krassx opened this issue Sep 8, 2016 · 11 comments

Comments

@krassx
Copy link

krassx commented Sep 8, 2016

I am using rollup.js in my build flow and it constantly fails to process Dexie due to circular dependecies in errors.js and Promise.js. They both seems to import utils and are imported by it.

I think we can get rid of these deps in utils.js and use plain Promise and hardcoded error definition.

@dfahlander
Copy link
Collaborator

Cyclic dependencies are supported by ES6 and rollup. https://github.com/rollup/rollup/wiki/Cycles.

@krassx
Copy link
Author

krassx commented Sep 12, 2016

I have read these docs, but that is no help. I always get Rollup warnings during build and eventually my final bundle fails to run. I had to fork Dexie and fix cyclic deps to make it work for me.

I think it's worth mentioning that I use 'iife' as a rollup output format, so I have no any modules as a result.

@dfahlander
Copy link
Collaborator

Dexie's build script uses rollup to output UMD format (IIFE, AMD, CJS combined) and it works perfectly. Which version of rollup are you using?

@krassx
Copy link
Author

krassx commented Sep 19, 2016

I am using 0.34.13.

@dfahlander
Copy link
Collaborator

dfahlander commented Sep 19, 2016

Ok, then it's more up-to-date than mine. Thanks for the response. I used to publish a rolled-up ES6 module at dist/dexie.es6.js but moved it away for some reason. The build script creates it though using rollup of src/Dexie.js. Maybe I should put it back again and start pointing jsnext:main to that version instead. Keeping this issue open as a reminder.

@krassx
Copy link
Author

krassx commented Sep 20, 2016

Would be really great to have it back. Thank you.

@dfahlander
Copy link
Collaborator

I've put dist/dexie.es6.js back and pointed package.json to it rather than pointing to src/Dexie.js. This should hopefully resolve the issue.

Please try:

npm install dexie@1.4.3-rc --save

... and report me back if it works for you.
Thanks,
David

@krassx
Copy link
Author

krassx commented Sep 28, 2016

Thank you. Will try and respond.

@krassx
Copy link
Author

krassx commented Sep 29, 2016

It works. Tried with 1.4.3-rc.

@dfahlander
Copy link
Collaborator

Good. The reason I get it working is because I've been using an older version of rollup. Cyclic dependencie are broken in the newest version of rollup, see: rollup/rollup#995

@krassx
Copy link
Author

krassx commented Oct 7, 2016

Got it. Thanks.

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

2 participants