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

Legacy Vaadin vaadin.initApplication is called sometimes too early. #105

Closed
johannest opened this issue Nov 30, 2021 · 0 comments
Closed
Assignees
Labels

Comments

@johannest
Copy link

johannest commented Nov 30, 2021

Happens at least on Vaadin 7 (7.7.14) and Vaadin 14 (14.6.8) with MPR.

Sometimes after login (pure V14 view) when the app is navigated to the main view containing some legacy content, the Vaadin 8 side initialization fails to Uncaught TypeError: vaadin.initApplication is not a function. It looks like that this vaadin.initApplication call happens right before V8 framework/VAADIN/vaadinBootstrap.js is completely loaded.

The resulting error:

Uncaught TypeError: vaadin.initApplication is not a function
at Object.eval (eval at hu (client-661F308588AD7572265EBD1D8EEA0A19.cache.js:1028), <anonymous>:3:8)
at hu (client-661F308588AD7572265EBD1D8EEA0A19.cache.js:1028)
...

Which happes after the request:

{
"syncId": 4,
"clientId": 3,
"EAGER": [
{
"url": "/framework/VAADIN/vaadinBootstrap.js",
"type": "JAVASCRIPT",
"mode": "EAGER"
}
.....
"browserDetailsUrl": "/framework",
"serviceUrl": "/framework",
"extraParams": "&ui=1"
},
"vaadin.initApplication($0, $1)"
],
[
"",
"document.title = $0"
]
]

Workaround: Add @javascript("context://framework/VAADIN/vaadinBootstrap.js"); to the V14 login view.

Proper fix would be customizing the loading of vaadinBootstrap.js such that it would be polled until really loaded and not calling vaadin.initApplication($0, $1) before.

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

No branches or pull requests

2 participants