-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Issue with crossfilter dependency #1261
Comments
Unfortunately I am not familiar with Node, and the folks who contributed Node support are no longer here. Should the argument to The underlying issue is that crossfilter2 is the name of a drop-in replacement for crossfilter. So the name of the module is not the name of the file (crossfilter.js). See #1214 for the related problem when using webpack. |
Anyway, I am planning to use webpack also. So the issue will be solved using |
We probably need to update Probably not a lot of people are using dc.js in Node. The switch to crossfilter2 was almost nine months ago. |
I've just been aliasing it.
|
Thanks @jdylanstewart - you mean you alias it using webpack? Or are there other ways? |
I alias in webpack and babel
|
Hm, why can't you just import the crossfilter library in your package.json. Using webpack here, I just added these three lines:
to my dependencies in package.json and import them like this:
Works fine for me. As a sidenote for you Gordon, dc.js works pretty well with Node and ES6. I imagined having more trouble with it. |
I am also getting this issue, using webpack and yarn. If I let
Using the proposal by @akuji1993 is wrong: |
Good to know. Still works for the stuff, that I have to do with it, but then it's probably not the right way if you want the newer stuff. Have to keep this in mind for more recent projects, thank you. |
@emiguevara did you try the alias solution from #1214? |
@gordonwoodhull yes, just tried it now. I can confirm that |
I'm going to close this. If there are any recommendations to help dc.js work with webpack without requiring special configuration, please lmk. |
Why not? I can't edit webpack config in my angular-cli project, so the way to use |
As explained in #1214, this does not work in AMD environments, where this specifies the name of the file instead of the name of the module. Sorry for the inconvenience - it seems that the only way to make both AMD and Webpack happy is to make http://github.com/crossfilter/crossfilter use the same name for its filename as for its NPM project name. |
Any updates on this issue? |
Hi @shusson. We discussed it in crossfilter/crossfilter#75, and I will release new 2.0.* and 2.1.* versions of dc.js which break requireJS in favor of webpack. Both requireJS users will have to either set up their builds to copy |
👍 awesome, thanks @gordonwoodhull |
this breaks requireJS but fixes webpack - since the community fork of crossfilter has a different package name from its filename, one or the other packaging system is going to be unhappy. requireJS users will need to rename crossfilter.js to crossfilter2.js when copying it into position, or use the requireJS paths or map configuration options to specify that the filename is different from the module name. http://requirejs.org/docs/api.html#config-paths http://requirejs.org/docs/api.html#config-map fixes #1213 fixes #1214 fixes #1261 fixes #1293 fixes #1302 breaks #1304!
As of dc.js 2.0.3 / 2.1.6, we'll break requireJS compatibility in favor of webpack compatibility. See #1304 if this creates problems for you. |
Thanks! Thanks! |
Hi there, I have a small problem with running dc example (stock.js). I added the next dependencies to my package.json:
After that I got the next error: Uncaught Error: Cannot find module 'crossfilter'.
To fix this issue I changed node_modules/dc/index.js:
from crossfilter to crossfilter2. Could you please help me with this issue? What is the proper fix? Or it is a problem with crossfilter ?
Thank you for your help in advance.
The text was updated successfully, but these errors were encountered: