Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Sometimes calculator loads before underscore #30710

Open
xymostech opened this issue Sep 24, 2012 · 5 comments
Open

Sometimes calculator loads before underscore #30710

xymostech opened this issue Sep 24, 2012 · 5 comments

Comments

@xymostech
Copy link
Contributor

The calculator util depends on underscore, but sometimes it tries to load before underscore has been loaded. They are both loaded on the same line (736 of khan-exercise.js):

Khan.require(["answer-types", "tmpl", "underscore",
    "jquery.adhesion", "hints", "calculator"]);

I am unsure why they are not simply loaded in order, and why it doesn't happen every time. I'm also not sure if putting a dependency would help this or not.

@beneater
Copy link
Contributor

I was able to see this behavior too, but only very rarely and I couldn't figure out how to reproduce it consistently. No idea why these wouldn't be loaded in order. Though it's entirely likely this would never happen in prod because in prod, underscore.js is loaded as part of shared-package, and calculator.js is part of exercise-content-package. Though I really don't understand all the mechanisms going on with how it's all loaded.

@beneater
Copy link
Contributor

@spicyj any idea why modules would load in an order other than the order they're listed?

@sophiebits
Copy link
Contributor

Oh, they're all loaded async. We can make it smarter.

@xymostech
Copy link
Contributor Author

@spicyj would adding in an underscore dependency for calculator help this?

@sophiebits
Copy link
Contributor

Nope.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants