about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorStephen Burgess <stephenburgess8@gmail.com>2017-05-16 19:59:43 -0500
committerEugen Rochko <eugen@zeonfederated.com>2017-05-17 02:59:43 +0200
commitabe0d9421f2bc6227360f9420aeac2cefbcdc023 (patch)
treeb2f65bd3f68b52e3f3a024c2f962cbda7fbad044 /app
parent7c1f3f8163d89b2b5ea0efbc16265771954c98bf (diff)
Catch import promise in application.js (#3041)
* 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
Diffstat (limited to 'app')
-rw-r--r--app/javascript/packs/application.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js
index 06f47b6b0..ea5b9f8f7 100644
--- a/app/javascript/packs/application.js
+++ b/app/javascript/packs/application.js
@@ -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();
 }