-
Notifications
You must be signed in to change notification settings - Fork 447
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
Falcor doesn't make requests when bundled with webpack #338
Comments
Model also seems to be included twice (and I imagine other modules also, based on how they are required). I also played with npm dedupe, resolve.alias with no luck. Webpack doesn't seem to do as thorough a job of removing duplicate modules [ with diff. absolute require paths ] as Browserify, hence the issue. I imagine it's some module state [ probably with Rx, and the way it has modules which modify the 'global' Rx export prototype ], which gets clobbered when the base Rx module is required a second time. Where I left it, it wasn't able to find the 'reduce' operator while trying to dispatch the request [ and the error was being swallowed ] |
So, with: 'webpack --output-library falcor --optimize-dedupe browser.js falcor-webpack.js' I can get rid of the duplicate Model. Still have a duplicate Rx module, which results in the MergeObservable coming out of the mergeAll() here: falcor/lib/request/RequestQueue.js Line 33 in 33fa8f3
Not having a |
I guess it's the rx.aggregates module which comes in and adds 'reduce', and so it's missing when the second copy of the rx core module is executed. |
Yeah, that is it. If I manually alias them in the built file (replace webpack_require_(N) with whichever version of the Rx module Rx.aggregate augments), it works fine. Will see if there's a way to do this externally through official webpack config channels [ it seemed like resolve.alias was that ], or change the structure of the require pulling in rx.aggregate, and see if that helps. |
In, falcor's entry point: falcor/lib/index.js We have:
And in other places, we have:
The references to However internally Webpack takes the AMD path, and is using Rx's package.json browser entry to translate these One is Since Webpack is taking the AMD path for |
@memoryhole : This fixes it for me:
Can you give it a try? The root cause is what I mention above. |
Since this is an RxJS bug, rather than a Falcor one, planning to resolve this by:
The cleaner permanent solution would be to have RxJS (or whichever Rx is bundled with Falcor) distributed as CJS modules, which we could require individually. |
RxJS Bug, with repro: Reactive-Extensions/RxJS#832 |
This should be closed due to PR merged and behavior "fixed". |
I'm looking at migrating a project from browserify to webpack. When I do so Falcor stops making network requests.
@sdesai mentioned he's seen a similar problem and suspected it was due to a duplicate Rx dependency in the bundle. I've tried adding the dedupe plugin and using
resolve.alias
directives in webpack, but the issue persists.The text was updated successfully, but these errors were encountered: