I'm currently developing two different React applications which use Deck.GL to render two maps, each with a different type of layer. When using them as standalone they both work perfectly, however, when the two get mounted in the same parent application, the second map I visit crashes (due to loading the library two times or so it seems).
Given that, I added Deck.GL to Webpack externals of both applications and added an unpkg link to the parent application. However, this gives an "Unable to resolve 'h3'" error, so I also put h3-js in externals but it keeps searching for it on Deck.GL javascript. My next step was to import from the @deck.gl/core, @deck.gl/react, @deck.gl/layers, etc instead and only load what is needed, but I got a similar error as it was searching for 'luma' in @deck.gl/layers.
So, how do I correctly define Deck.GL as a Webpack external?
Edit:
The error I get when adding deck.gl to externals:
Unable to resolve bare specifier "h3" from https://unpkg.com/deck.gl@7.3.6/dist.min.js
The errors when I navigate to the second map which uses different layers:
It seems this error is launched when using Angular routing to navigate through the page, if I use simple
<a href>
they work perfectly because it reloads the whole page and doesn't load two instances of the library.