@xh/hoist 56.4.0 → 56.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## v56.4.1 - 2024-04-25
4
+
5
+ ### 🐞 Bug Fixes
6
+
7
+ * Fixed over-eager error handler installed on window during preflight app initialization. This can
8
+ catch errors thrown by browser extensions unrelated to the app itself, which should not block
9
+ startup. Make opt-in via special query param `catchPreflightError=true`.
10
+
3
11
  ## v56.4.0 - 2023-05-10
4
12
 
5
13
  ### 🎁 New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "56.4.0",
3
+ "version": "56.4.1",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -21,18 +21,20 @@ window._xhLoadTimestamp = Date.now();
21
21
  }
22
22
  })(window);
23
23
 
24
- // Catch errors that occur before our in-app exception handling takes over.
25
- window.onerror = function(errorMsg, url, line, col, error) {
26
- document.body.innerHTML = (
27
- '<div style="margin: 60px auto; font-family: sans-serif; width: 450px; max-width: 80%; text-align: center; padding: 20px; border: 1px solid #ccc;">' +
28
- '<strong>This application can not be loaded in your current browser</strong><br/><br/>' +
24
+ // Use flag below to catch and stop on errors that occur before in-app exception handling active.
25
+ if (window.location.search.toLowerCase().indexOf('catchpreflighterror=true') != -1) {
26
+ window.onerror = function (errorMsg, url, line, col, error) {
27
+ document.body.innerHTML = (
28
+ '<div style="margin: 60px auto; font-family: sans-serif; width: 450px; max-width: 80%; text-align: center; padding: 20px; border: 1px solid #ccc;">' +
29
+ '<strong>This application can not be loaded in your current browser</strong><br/><br/>' +
29
30
  '<div style="text-align: left">' +
30
- errorMsg + '<br/>' +
31
- '<div style="padding-left: 3em; overflow-wrap: anywhere;">' +
32
- 'at ' + url + ':' + line + ':' + col +
33
- '</div>' + '<br/><br/>' +
34
- window.navigator.userAgent +
31
+ errorMsg + '<br/>' +
32
+ '<div style="padding-left: 3em; overflow-wrap: anywhere;">' +
33
+ 'at ' + url + ':' + line + ':' + col +
34
+ '</div>' + '<br/><br/>' +
35
+ window.navigator.userAgent +
35
36
  '</div>' +
36
- '</div>'
37
- );
38
- };
37
+ '</div>'
38
+ );
39
+ };
40
+ }