Au2 shadowdom does not work with pushstate enabled routing

connected to previous question but more targeted and narrowed down to the problem

[dumber gist is here]( 1)

creating a new app using au2 new or npx makes aurelia works fine out of the box with shadowdom and hash based routing.

but once you change the routing configuration to use pushstate (while you already enabled shadowdom at the time of app new), routes no longer work.

all routes on click will break with error message

projectors.js:41 Uncaught (in promise) DOMException: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree.
at new ShadowDOMProjector (http://localhost:9000/entry-bundle.js:19668:32)
at HTMLProjectorLocator.getElementProjector (http://localhost:9000/entry-bundle.js:19643:20)
at Controller.hydrateCustomElement (http://localhost:9000/entry-bundle.js:31845:43)
at Function.forCustomElement (http://localhost:9000/entry-bundle.js:31780:20)
at ViewportContent.loadComponent (http://localhost:9000/entry-bundle.js:15138:92)
at Viewport.canEnter (http://localhost:9000/entry-bundle.js:15958:32)
at async http://localhost:9000/entry-bundle.js:13433:38
at async Promise.all (index 0)
at async Router.processNavigations (http://localhost:9000/entry-bundle.js:13432:27) 

is it a bug? or do I need additional configuration to make it work?

1 Like

This seems to be a variation of an error related to this issue here.