Closed lpellegr closed 5 years ago
@usergenic @aomarks Any ideas about what could be the issue?
@lpellegr will take a look.
@usergenic Any joy with a fix for this?
If you blow out the yarn.lock here and do a fresh yarn install it should show this issue has been fixed.
Using polymer-cli@1.9.2
Here is a repository for reproducing the issue:
https://github.com/lpellegr/pwa-starter-kit-firebase-storage-packaging
The example is based on pwa-start-kit-no-redux template. I have simply added the following lines:
https://github.com/lpellegr/pwa-starter-kit-firebase-storage-packaging/commit/6117f376263d42c6514cec73a0c2be9f64752e39
Run
yarn install
,polymer serve
, openhttp://127.0.0.1:8081
.At this stage, with no bundling the app works properly. All firebase modules are loaded (included storage).
Now, run
yarn build:prpl-server
,yarn serve:prpl-server
, then openhttp://127.0.0.1:8080
.On Chrome, I get the following error:
On Firefox the error is different most probably because served with
es6
flavor instead ofesm
:The fact that the app works with no bundling let's me think there is something wrong with Polymer bundler or a dependency used by it. Unfortunately, I have no knowledge about this part. Any ideas are welcome.
Why not importing Firebase using ES6 imports? There seems to be another issue too.
As a workaround, importing the global Firebase dependency (in
public/index.html
) allows creating working bundles:However, it has the drawback to load not required dependencies (e.g. firebase-messaging) but also to display a warning in production: