-
Notifications
You must be signed in to change notification settings - Fork 446
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
Webpack #586
Comments
Update: Tried the #428 approach, didn't work with latest version of Rx
In source this refers to:
|
Hey @IwanKaramazow We're in the process of removing the internal falcor dependency on Rx so there isn't really any value in upgrading to the latest version of Rx, which has the fix for this webpack issue (there's a migration cost, since it's a major bump in the rx version and signature changes), so you'd need to stick with the workaround for Rx.
If it's the later, you'll need to point to the explicit path to rx.js from your webpack config, since falcor will be in your ./node_modules. See the 'Workaround Notes' here. You can try literally hardcoding the path to rx.js (instead of using require.resolve) to see if that's actually the issue. Alternatively if you don't use AMD for your modules, you could try disabling webpack's AMD parsing: a. npm i imports-loader
|
Thanks for the response! I'm trying to build with Falcor as a dependency. Seems this fixes the original issue:
but... the following code breaks in rx.js:
Next file that breaks: falcor/lib/errors/InvalidSourceError.js
Same thing happens with InvalidModelError.js, MaxRetryExceededError.js Known issue? I think for now I'll insert a script tag w/"https://netflix.github.io/falcor/build/falcor.browser.js" |
I'd be worried about commenting out the this.inherits line. If your project is available on github, I can try and help you configure it using one of the methods I mention above. It should be pretty straight forward. The InvalidSourceError is not a known issue, but if you can file it, we can take a look at it. Which version of Firefox is this, and is it the only browser you're seeing it on? In theory (as per ES6 spec) I believe |
I'm using firefox 41.0.2, I suspect it has something to do with commenting out too much code. If you could spare some time, it would be really nice if you could take a look at my project. |
Looked at your repo. Unfortunately all of these hacks are required.
If you file it we can take care of it. If you need to work around it locally for now, you can uncomment the lines which set .name on the constructor function for everything in falcor/lib/errors. The browsers enforce .name being read-only when using "use strict". We should be able to fix this. I'm not sure the .name is actually required (depending on our browser support matrix).
The root issue here is really a Babel + RxJS issue. It looks like Babel runs with an undefined "this" as the top level context. The only way we'd be able to address this in Falcor is once Rx 2 is removed (or upgraded to an another version of Rx). I'm not sure if there's a Babel configuration you could use to control See: Reactive-Extensions/RxJS#850
If I take care of these issue your app builds/works fine with the local falcor. I'll let you know if I can figure out how to get c working. |
For c) above, this fixes it also, in your build env... [ in webpack.config.frontend.js ]
For whatever webpack/build pipeline reason (and you have a pretty complex build pipeline), the require.resolve() at the point in time at which your webpack.config is processed just gives you back the webpack id of the module (e.g. '12' for rx/dist/rx) instead of the pull path to the file. Alternatively, you can do this, to disable AMD parsing for rx.aggregates.js (or other files if you want). This also fixes the issue with rx.aggregates.js ...
For a) and b) there may be something in Babel's config you can do to stop it.
To avoid all the workarounds, at least until we can remove Rx and fix the .name issue. |
Thanks for the input, really appreciate it! I somehow got it the RX dependency working, but... 😁
Should probably be I'll go with a Thanks anyway for the help! 👌 |
The latest falcor (0.1.14) and falcor-router should have all these fixes [ function.name, global leaked |
What's the current status of the webpack issue?
I installed rx trough npm and added the following code to my webpack config
I get a:
Pointing the rx$ alias to 'falcor/node_modules/rx/dist/rx' doesn't solve the problem either:
=> webpack builds, but I get:
Is this an issue with Falcor, or did I mess something up?
The text was updated successfully, but these errors were encountered: