I'm having trouble with Webpack 4, trying to preload some data with an async chunk, then when data is loaded, append an other chunk computed with webpack to the dom.
Both chunks use the same instance, a Singleton, once as a container while loading data, the other time to read those loaded datas.
I hope it's as clear as possible. It was working with Webpack 3, might be some luck we had for over 6 months, but we migrated to webpack 4 today, and the symptom is quite clear :
- in the first chunk, while loading datas, the instance is created and populated. When trying to use the datas in this context, it seems ok.
- in the second chunk, loading afterwards, the instance does not exist, or is not populated.