OHDSI / Atlas

ATLAS is an open source software tool for researchers to conduct scientific analyses on standardized observational data
http://atlas-demo.ohdsi.org/
Apache License 2.0
258 stars 126 forks source link

Uncaught TypeError: ko.i18n is not a function #2851

Closed m0nhawk closed 1 year ago

m0nhawk commented 1 year ago

Expected behavior

Actual behavior

Uncaught TypeError: ko.i18n is not a function
    at Object.<anonymous> (const.js:6:19)
    at Object.execCb (require.js:29:390)
    at Z.check (require.js:18:423)
    at Z.enable (require.js:23:330)
    at Z.init (require.js:17:68)
    at E (require.js:14:185)
    at Object.completeLoad (require.js:28:219)
    at HTMLScriptElement.onScriptLoad (require.js:30:10)

Steps to reproduce behavior

  1. Load using Chrome (Version 112.0.5615.49) and Atlas (2.12.0), somehow it doesn't happen every time, and mostly happen to new users and old returning users.

I would appreciate any ideas on why it's happening and how to debug (and provide more information), but that was a frustrating issue to caught.

chrisknoll commented 1 year ago

This is a race condition: the dynamic loader is fetching the dependencies, but something is assuming the i18n plugin has been loaded, without declaring it a dependency.

We have some bootstrap dependencies that can be loaded, and the i18n one should be part of it. I will take this on and report back when a patch is available.

chrisknoll commented 1 year ago

Could you try this PR on your local env and see if that resolves it for you?

m0nhawk commented 1 year ago

@chrisknoll Thank you, I will try today-tomorrow, will update as soon as I get any updates.

m0nhawk commented 1 year ago

I have deployed the fix, and it seems to work fine. I'll keep it running to see if the error pop up again, but as of right now I see that the amount of network requests have halved — from ~1700 to ~750 and it became quite snappier to load.

m0nhawk commented 1 year ago

I can't reproduce it, and I don't see this happening for the users. 🎉

chrisknoll commented 1 year ago

Fixed in #2852