-
Notifications
You must be signed in to change notification settings - Fork 144
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
Google Web Font Loader (in Dataviz package) breaks RequireJS global queue #341
Comments
I was able to workaround this by loading only keen-tracker.js. Nevertheless, for applications sharing RequireJS and the data visualization tools from Keen, this should be worked out. |
Same issue |
@frankrue @jpolo thanks for reporting this, and sorry for the roadblock! RequireJS has been incredibly difficult to support in parallel with other loading/env contexts, so any insights or suggestions you can share would be incredibly helpful. I'm guessing there are lots of interesting design patterns and techniques in the RequireJS world that I just haven't seen or considered yet. At first glance, I wonder if the |
I'll take a look at the plugins. As I said: I'm not blocked at this point. Using the slimmer |
I would suggest to trace the code that could load the library in a script tag. The library then detects that a define global is present and calls it. Because of the direct script tag creation there is no require context attached to the define and the call create an error. |
It seems that the bug is present in the v1.1 of google/visualization because with v1 I have no problem. I recently found a workaround that might be useful for other users : the //my_keen.js
define(["depend!keen-js/keen[google/visualization]"], function () {
})
//google/visualization.js
define(["goog!visualization,1,packages:[corechart,geochart,table]"], function () {
return google.visualization;
}) This peace of code makes sure that google chart is loaded before keen. For the keen.js library the quick fix would be to downgrade google chart to v1 (if possible...). The more robust solution for the future :
|
Just FYI: I just hit this too. Large RequireJS project, added Keen, all looked good locally, released to my users and started getting swamped with errors in my logs, because on a small percentage of page loads RequireJS unexpectedly breaks, and some files don't get given their dependencies as they're initialized (so I get exceptions like "'Coord' is not a function", because the dependency on my Coord module has actually just received null instead), and the whole app setup crashes and burns. This is pretty bad! This is despite using the correct paths config from the README (although I notice you've just now also added a reference to this bug in there). Seems to have been fixed instantly by just moving to the tracker script, but of course it's hard to tell. I've just burned quite a lot of time on this, and it seems a bit crazy that you're supplying a RequireJS module that by default breaks any substantially-sized project it's used in. I can see how it's hard to fix, but there's potentially quite bad results from intermittent issues like this. Lots of people (like me) won't catch application-break issues until production! Have you considered just recommending RequireJS users use only the tracker module in the readme directly? |
Another large RequireJS project here, got a couple of nice charts going and then struck problems shortly after. Error: Mismatched anonymous define() module: function (){return $} http://requirejs.org/docs/errors.html#mismatch |
@pimterry @bjj951 finally found a resolution for this.. check this comment out: #112 (comment) |
We are using Keen in a complex browser/client environment. In our scenarios, we frequently need to pull dynamic AMD modules into our JS namespace. RequireJS always checks the "global queue" when pulling new modules to finish any problem loaders.
All of a sudden, Google's Web Font Loader is kicking back a "null" in the RequireJS global queue, and failing our dynamic AMD modules.
If there is a way to disable the Dataviz package in Keen, since we're only using the WRITING features for our project, this error would stop.
The text was updated successfully, but these errors were encountered: