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

EventHandlerUI fails in Safari #1628

Closed
SomeoneToIgnore opened this issue May 19, 2017 · 9 comments
Closed

EventHandlerUI fails in Safari #1628

SomeoneToIgnore opened this issue May 19, 2017 · 9 comments
Labels
Milestone

Comments

@SomeoneToIgnore
Copy link
Contributor

Launch test-root-context jetty in flow, open
http://localhost:8888/run/com.vaadin.flow.uitest.ui.template.EventHandlerUI

Expected: a view with elements
Actual: empty page, errors in browser and server consoles.

May be related to #1215

@caalador
Copy link
Contributor

caalador commented May 23, 2017

The problem has something to do with the <link rel="import" href="/bower_components/polymer/polymer.html">

for some reason this leads Safari to try getting the polymer html imports from:
/run/lib/legacy/legacy-element-mixin.html instead of the correct:
/bower_components/polymer/lib/legacy/legacy-element-mixin.html
But when actually clicking the import in inspector after failing load it resolves correctly and loads the file.

Moving the import to a HtmImport in the template file fixes this problem
@HtmlImport("/bower_components/polymer/polymer.html")

Having or not having the <base href="."> didn't change the behaviour.

@caalador caalador removed their assignment May 23, 2017
@Legioth
Copy link
Member

Legioth commented May 23, 2017

It would still be preferable to have those kinds of imports from inside template files instead of as @HtmlImport from the java side.

Might work with a relative path for the import URL instead of an absolute one, e.g. <link rel="import" href="bower_components/polymer/polymer.html">.

@caalador
Copy link
Contributor

The problem would seem to be somewhere in how the tests pacakge is setup and built as the polymer demos work fine.

@SomeoneToIgnore
Copy link
Contributor Author

SomeoneToIgnore commented May 30, 2017

I've failed to understand the root cause of the problem.
One more addition is that it's not connected with servlet implementation, since I've replaced UI with View (that has different url and servlet responsible for loading) and the error is still the same: Safari tries to get the resources via http://localhost:8888/view/lib/... url

I've went even further and copy-pasted the code to HelloWorld and it runs normally.
I suppose, the problem is in one of the pom.xml: this can be either jetty or frontend plugin issues.

@Legioth
Copy link
Member

Legioth commented Jun 16, 2017

Seems to be caused by a bug in the polyfill, reported as https://github.com/webcomponents/html-imports/issues/62.

We can work around this by not using an absolute URL for loading polymer.html.

@Legioth
Copy link
Member

Legioth commented Jul 19, 2017

Bugfix included in 1.0.2 of webcomponetnsjs.

@Haprog
Copy link
Contributor

Haprog commented Sep 18, 2017

Looking latest comments by @Legioth should this issue be closed?

@Legioth
Copy link
Member

Legioth commented Sep 19, 2017

Should be verified that it's actually fixed.

@SomeoneToIgnore
Copy link
Contributor Author

The correct link now is : http://localhost:8888/view/com.vaadin.flow.uitest.ui.template.EventHandlerView

Works for me and Safari Version 11.0 (12604.1.38.1.7)

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

5 participants