react-microfrontends / navbar

Core navigation
14 stars 29 forks source link

Setting up moment as a shared dependency fails #4

Closed TheMcMurder closed 4 years ago

TheMcMurder commented 4 years ago

run: localStorage.setItem('import-map-override:moment', 'https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js') in the console while on this page https://react.microfrontends.app/

And run this branch locally with an override to see the error.

joeldenning commented 4 years ago

This is caused by the same problem described in https://github.com/react-microfrontends/api/issues/1. It is fixed in https://github.com/webpack/webpack/pull/10503, which will be published in the next webpack@5 beta.

In the meantime you can work around it with an ad hoc systemjs extra (see this commit, https://github.com/react-microfrontends/api/issues/1#issuecomment-594289086, and this code sandbox)