]> cat aescling's git repositories - mastodon.git/commitdiff
Catch import promise in application.js (#3041)
authorStephen Burgess <stephenburgess8@gmail.com>
Wed, 17 May 2017 00:59:43 +0000 (19:59 -0500)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 17 May 2017 00:59:43 +0000 (02:59 +0200)
* fix(polyfil): Catch error from promise

https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html

* fix(catch): Error

Make import promise catch a noop with commented out console.log for a debugging hint.

* fix(eslint): Disable eslint console rule

* fix(application): Use console error

app/javascript/packs/application.js

index 06f47b6b05a98bb0c6d4ccda3d8e55434ba59825..ea5b9f8f7ac8aa8b21b82b59d57594d85fb12dcf 100644 (file)
@@ -3,7 +3,9 @@ import main from '../mastodon/main';
 if (!window.Intl || !Object.assign || !Number.isNaN ||
     !window.Symbol || !Array.prototype.includes) {
   // load polyfills dynamically
-  import('../mastodon/polyfills').then(main);
+  import('../mastodon/polyfills').then(main).catch(e => {
+    console.error(e) // eslint-disable-line no-console
+  });
 } else {
   main();
 }