Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts.io spawned app with WC polyfill breaks on unload #916

Open
Kian-Esmaeilpour opened this issue Dec 4, 2019 · 0 comments
Open

ts.io spawned app with WC polyfill breaks on unload #916

Kian-Esmaeilpour opened this issue Dec 4, 2019 · 0 comments

Comments

@Kian-Esmaeilpour
Copy link
Contributor

Describe the bug
In IE11 if you have the WC polyfills and tradeshift-ui together in a spawned app by ts.io, if you leave the app and somehow close its iframe you would get the following error:

Unable to get property 'getPrototypeOf' of undefined or null reference

in some cases it's only happening when developer tools is open in some other all the time.

To reproduce

  1. You need to open the developer tools in IE11 first
  2. Spawn an app (we used the app store app to spawn tasklist app for testing)
  3. Close this app by moving to another app or calling the submit method of ts.io

Framework usage
React v16.11.0

Desktop (please complete the following information):

  • OS: Windows
  • Browser: IE
  • Version: 11

Additional context
The part triggering ts-ui ts.io issue in IE11

Line 181 of gui.Document.js

		/**
		 * Dispatch `unload` event to hosting document.
		 * TODO: https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching
		 */
		_onunload: function() {
			this._unloaded = true;
			gui.$shutdown();
			dobrodcast(gui.BROADCAST_TOUNLOAD, gui.BROADCAST_ONUNLOAD);
this one-->	doaction(gui.ACTION_DOC_UNLOAD, location.href);
		},

which ends in gui.Action.js , _dispatch method! and the exact line causing the issue line 394

		transcend: function(win, uri, key) {
			var msg = gui.Action.stringify(action, key);
this one -->	win.postMessage(msg, '*'); // uri
		}

The value for msg:

spiritual-action:{"target":null,"type":"gui-action-document-unload","data":"http://localhost:5000/v4/apps/Tradeshift.TaskList/","direction":"ascend","global":true,"instanceid":"key256436221"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant