SchweizerischeBundesbahnen/scion-workbench

Workbench component can be mounted only once

Closed this issue · 1 comments

Describe the bug

When the workbench is displayed in a router outlet, the workbench component fails to instantiate if it was displayed before, e.g., when navigating to another component and then back to the workbench component. The following error is thrown: [ViewContainerReferenceError] ViewContainer already set.

To Reproduce

Steps to reproduce the behavior:

  1. Add a router outlet
  2. Define a route and associate it with the workbench component
  3. Navigate to that route
  4. Navigate to another route
  5. Navigate back to the workbench route

Expected behavior

The workbench should allow being mounted again.

Environment

SCION Workbench version: 11.0.0-beta.3

ERROR Error: [ViewContainerReferenceError] ViewContainer already set.
at ViewContainerReference.set (view-container.reference.ts:27)
at WorkbenchComponent.set injectIframeHost [as injectIframeHost] (workbench.component.ts:38)
at WorkbenchComponent_Query (workbench.component.ts:41)
at executeViewQueryFn (core.js:8554)
at refreshView (core.js:7228)
at refreshComponent (core.js:8325)
at refreshChildComponents (core.js:6964)
at refreshView (core.js:7221)
at refreshComponent (core.js:8325)
at refreshChildComponents (core.js:6964)