Bastion (angular) pages not loading in Katello dev environment

link to workaround

Hey all,

Katello’s angular pages are not showing when you navigate to them. They work fine on reload, but when you go click a menu option to navigate to them, you get this error:

bastion-566fa46ff8075b9c8d3c9545374f711ea1de1ad28062112ada4a9926843218f0.js:16803 Uncaught Error: [ng:btstrpd] App already bootstrapped with this element 'document'
http://errors.angularjs.org/1.5.5/ng/btstrpd?p0=document
    at bastion-566fa46ff8075b9c8d3c9545374f711ea1de1ad28062112ada4a9926843218f0.js:16803
    at doBootstrap (bastion-566fa46ff8075b9c8d3c9545374f711ea1de1ad28062112ada4a9926843218f0.js:18462)
    at Object.bootstrap (bastion-566fa46ff8075b9c8d3c9545374f711ea1de1ad28062112ada4a9926843218f0.js:18502)
    at bastion-566fa46ff8075b9c8d3c9545374f711ea1de1ad28062112ada4a9926843218f0.js:88803
    at HTMLDocument.<anonymous> (application-2c2433c433074b80adc998e06df01937bf13459ed0fb28dea9b6b88586c2e06e.js:30)
    at HTMLDocument.dispatch (jquery.js:4737)
    at HTMLDocument.elemData.handle (jquery.js:4549)
    at Object.trigger (jquery.js:7807)
    at HTMLDocument.<anonymous> (jquery.js:7875)
    at Function.each (jquery.js:365)

It looks like this line is causing some issues and I’m guessing react and angular’s router are navigating to the same page and both trying to bootstrap the document.

I came up with a workaround but I think we need to discuss a permanent fix. Any ideas?

CC @ohadlevy @gilad215

this seems like the root cause, @gilad215 I wonder if we have anyway to fetch the data directly from the menu (before moving to the router, the menu item had a no-turbolink attribute).

PR at https://github.com/theforeman/foreman/pull/6790

created a PR. please take a look.
Items that don’t want turbolinks need the following syntax (example)

menu.item :statistics, :caption => N_('Statistics'), :turbolinks => false

@ohadlevy @gilad215: thank you both for the quick response and PR :+1:

@gilad215 will our existing menu definition work with this approach?

Yes :slight_smile:
please update if it works

PR was merged, please let me know if you face any additional issues

2 Likes