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

error bundling with rollup 0.36.1 #59

Closed
davelandry opened this issue Sep 30, 2016 · 2 comments
Closed

error bundling with rollup 0.36.1 #59

davelandry opened this issue Sep 30, 2016 · 2 comments

Comments

@davelandry
Copy link

When creating a custom bundle using rollup 0.36.1 and the treemap function exported by d3-hierarchy, I get the following error in the browser console:

Uncaught TypeError: Cannot create property 'y0' on number '1.618033988749895'

Which points to the following line:
https://github.com/d3/d3-hierarchy/blob/master/src/treemap/index.js#L20

It only happens when I initialize the treemap function. If I comment out the line treemap() it bundles correctly.

import {treemap} from "d3-hierarchy";

export default function() {
  treemap();
}

Not sure if this is a d3-hierarchy bug or a rollup bug, so I apologize if this issue is misplaced.

@mbostock
Copy link
Member

Sorry, but this isn’t enough information for me to investigate. What is the entry point to the bundle? The code you’ve included doesn’t look valid, because it’s calling the treemap constructor and then discarding the result. Probably the error lies in other code, most likely the root node you’re passing to the treemap instance.

When reporting an issue, please include a link to a live example, preferably on bl.ocks.org or RunKit, or as a pull request in the appropriate repository with new unit tests, that demonstrates that the described behavior is not the expected behavior. Use only the minimum amount of code necessary to reproduce the unexpected behavior.

A good bug report should isolate specific methods that exhibit unexpected behavior and precisely define how expectations were violated. What did you expect the method or methods to do, and how did the observed behavior differ? The more precisely you isolate the issue, the faster I can investigate.

Non-actionable bugs may be temporarily closed until you provide additional information. If you can’t isolate the bug any further, please let me know and I will try to help. However, I beg your patience: I must balance your request against many other responsibilities—fixing other bugs, answering other questions, new features, new documentation, etc. Please also consider asking for help on Stack Overflow.

If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.

Thank you! 🤗

@davelandry
Copy link
Author

Fair enough. I can't imagine how much you must be bombarded every day with crap posts. Sorry to add to the clutter.

I've created a self-contained repo that shows the error: https://github.com/davelandry/rollup-d3

The only thing I can think of that I forgot to mention in the initial post is that I'm using rollup-plugin-node-resolve. At the risk of cross-pollonation, I've also posted this issue in the rollup repository (as I'm starting to think that may be the culprit): rollup/rollup#1009

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

No branches or pull requests

2 participants