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

Clearing router outlet logs errors #216

Open
danielwiehl opened this issue Dec 23, 2022 · 0 comments
Open

Clearing router outlet logs errors #216

danielwiehl opened this issue Dec 23, 2022 · 0 comments

Comments

@danielwiehl
Copy link
Collaborator

danielwiehl commented Dec 23, 2022

Describe the bug

When clearing a router outlet, wrong origin errors are logged to the console:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin

To Reproduce

Steps to reproduce the behavior:

  1. Open Testing App of the SCION Microfrontend Platform: https://scion-microfrontend-platform-testing-app.vercel.app/
  2. Open the DevTools (DevTools toggle button in the upper right corner)
  3. Load the router page into the left outlet: https://scion-microfrontend-platform-testing-app1-v1-0-0-rc-12.vercel.app/#/outlet-router
    3.1. Enter 'devtools' into the outlet field
    3.2. Click 'Navigate'
  4. See the errors logged to the console: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://scion-microfrontend-platform-devtools-v1-0-0-rc-12.vercel.app') does not match the recipient window's origin ('https://scion-microfrontend-platform-testing-app.vercel.app').

Analysis

  • The outlet is cleared as expected.
  • Errors are only logged for outlets embedded directly in the host app
  • When unloading the microfrontend, the microfrontend unregisters from active messaging subscriptions in the broker (MicrofrontendPlatformStopper -> unload -> MicrofrontendPlatform.destroy). The broker then replies with acknowledgments. In the meantime, the outlet has been unloaded and replaced with about:blank, causing the errors due to the origin mismatch.

Expected behavior

No errors are logged to the console.

Environment

Please complete the following information:

SCION Microfrontend Platform version: 1.0.0-rc.12
Browser: Chrome 108.0.5359.125

@danielwiehl danielwiehl changed the title Clearing Clearing a router outlet logs errors in the console Dec 23, 2022
@danielwiehl danielwiehl added this to Triage in SCION via automation Dec 23, 2022
@danielwiehl danielwiehl changed the title Clearing a router outlet logs errors in the console Clearing router outlet logs errors in the console Dec 23, 2022
@danielwiehl danielwiehl changed the title Clearing router outlet logs errors in the console Clearing router outlet logs errors to the console Dec 23, 2022
@danielwiehl danielwiehl changed the title Clearing router outlet logs errors to the console Clearing router outlet logs errors Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
SCION
  
Triage
Development

No branches or pull requests

1 participant