Closed jefffriesen closed 8 years ago
I tested reductio@0.4.0, which uses crossfilter2 but got the same Module not found
errors.
Installing reductio@0.3.0 which depends on crossfilter 1 ("crossfilter": "^1.3.7"
) works properly.
Sigh :-( I suspect it is because the package.json didn't get updated properly. It still has
"browserify-shim": {
"crossfilter": "global:crossfilter"
}
and I suspect it should be
"browserify-shim": {
"crossfilter2": "global:crossfilter"
}
Would you mind trying that locally and seeing if it fixes your problem?
Hmmm. I guess those require's in the files you list will need to be changed to require crossfilter2 as well. I'll see if I can get a new release pushed shortly that fixes this.
Can you try version 0.5.4?
Ok. That may fix it. But I'm not using browserify. I'm using webpack, which I think just pays attention to the normal package.json
's dependencies. There are ways to shim non-standard modules (https://webpack.github.io/docs/shimming-modules.html). I've tried the webpack.ProvidePlugin
plugin on this page. I know debugging webpack and other bundlers can go down a black hole though. I think if the modules are exported properly for commonJS format it should just work (famous last words).
Just saw your commit - I'll try 0.5.4
Yeah, I expect if you are using web pack you are going to use the dependency. I only realized that the Browserify-specific stuff is irrelevant after my first response. Sorry.
I'm using Browserify as part of my distribution build. I don't want to include Crossfilter in the distro - therefore the browserify-shim, but you're not using the distribution file, so it's beside the point. If you have Crossfilter on your page directly, you may want to shim it yourself so that you aren't sending it to the browser twice.
Yep - that loaded everything fine. Thanks. Good call on de-duplicating crossfilter. I'm not sure if I can do that because I can't get dc.js working with crossfilter2. I wonder if it needs similar changes.
In this particular instance having crossfilter1 and crossfilter2 should be fine because it's an Electron app and the incremental weight for distribution is negligible for our use case.
Thanks again.
@jefffriesen The dc.js develop branch just switched to Crossfilter2, but no release yet. Almost there :-)
Oh, also, the next release of Crossfilter 2 is going to be 1.4.x, so look for the 1.4.0-alpha releases for the immediate future. Reductio will switch to 1.4.0-alpha.x eventually, as those are newer than the 2.0.0-alpha releases (which should now be ignored). Sorry for the confusion.
Great. Thanks for fixing this.
I'm using reductio 0.5.3 in a CommonJS environment (webpack in my case).
I'm getting
Module not found: Error: Cannot resolve module 'cross filter'
in these reductio modules:Reductio 0.5.3 has this dependency:
"crossfilter2": "^2.0.0-alpha.03"
. I don't know if there is a problem in reductio or crossfilter2. Previously I actually tried to use crossfilter2 with dc.js but gave up because I couldn't get dc.js to require it properly. Maybe crossfilter2 isn't exporting it's modules properly? Maybe this belongs in crossfilter2's repo, but the error is originating from Reductio so I wanted to let you know about it.I've tried quite a few webpack shenanigans to get it to work, including the ones that are used with modules that weren't originally built to work in a CommonJS environment. But none of them worked. I've got lots of other modules working in my environment, which leads me to think it has something to do with reductio or crossfilter2.
Thanks