-
Notifications
You must be signed in to change notification settings - Fork 82
Issues with angularfire2 (Angular + Firebase integration) and devserver #56
Comments
The issue here is inside the UMD bundle you get from firebase. They use an anonymous More broadly, the issue is that the module loading in ts_devserver works for TS code built by bazel, but not for externally built code. One option is what @thelgevold published on http://www.syntaxsuccess.com/viewarticle/angular-bazel-build-with-dev-server - using SystemJS as the loader for these external bundles, while require.js is the loader for the bazel-built bundles. He could probably help out here since he's a core contributor to ABC. Another option, well worth considering in this case, is for AngularFire to ship with BUILD files. If you had a source dependency on it, then you'd get the JS transpiled with the ts_library rule, then it's just a bazel-to-bazel dependency and require.js is a sufficient loader. That's how rxjs is handled in this example repo. It's tracked in bazelbuild/rules_typescript#126 /cc @IgorMinar has been working on improving the integration with firebase, fixing some unrelated runtime issues with zones. |
Thanks Alex. I've logged a feature request with Firebase and will see if I can figure out an alternative way to load the module in the devserver (such as using SystemJS) in the meantime. |
Link to the firebase issue? |
I originally filed it through https://firebase.google.com/support/, which doesn't appear to be globally linkable. I'll log another one at https://github.com/angular/angularfire2 and link to it shortly. Edit: angular/angularfire#1431 |
Let's use that firebase issue to track, as well as https://github.com/bazelbuild/rules_typescript/issues/103 for general issues with serving third-party libs. |
Hey Alex, I have been having trouble adding the angularfire2 package (Google-maintained, Firebase-related Angular modules) as a dependency to my app and getting it to serve from the devserver correctly.
I thought the basic steps would be to add the relevant
*.umd.js
files to thescripts
argument ofts_devserver
, but that appears to cause the following requirejs error:Uncaught Error: Mismatched anonymous define() module: function (exports,_angular_core,firebase,rxjs_scheduler_queue) { 'use strict';
.I'm not really sure what I need to be doing to troubleshoot this. Do you have any advice? I'm not sure if the issue is with my code, or with the devserver, or with the angularfire2 package.
I've created a repro at #55.
The text was updated successfully, but these errors were encountered: