Open pdpinch opened 7 years ago
This problem is coming from RRSSB, the social sharing widget we're using. It depends on jQuery, and assumes that it is already loaded in the global context. It looks like RRSSB is imported in entry/public.js
, while jQuery is imported (and put into the global context) in entry/style_public.js
, so there's a race condition here.
@aliceriot, do you know why this was set up this way?
I'm not sure what the justification was, probably not wanting to import it twice or something. That shouldn't be a concern though, now that we're using webpack's CommonChunkPlugin
to pull out common code.
@aliceriot Does that mean that we can import jQuery in entry/public.js
to resolve the race condition, and not increase the file size? I'm not familiar with how CommonChunkPlugin
works.
Yep, that's exactly what it means. CommonChunkPlugin
looks at all of the code and finds chunks which are common to different entry points, and it pulls these out into a separate bundle. We have it set so that anything which is present in 2 or more places should be pulled out.
some kind of network failure?
https://sentry.io/mit-office-of-digital-learning/micromasters/issues/190464647/