-
Notifications
You must be signed in to change notification settings - Fork 57
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
PWA endpoint errors while called from SW #2867
Open
krissvaa opened this issue
Oct 24, 2024
· 0 comments
· May be fixed by vaadin/flow-hilla-common#16, #2900 or vaadin/flow#20470
Open
PWA endpoint errors while called from SW #2867
krissvaa opened this issue
Oct 24, 2024
· 0 comments
· May be fixed by vaadin/flow-hilla-common#16, #2900 or vaadin/flow#20470
Comments
krissvaa
added a commit
to vaadin/flow-hilla-common
that referenced
this issue
Nov 11, 2024
krissvaa
added a commit
to vaadin/flow-hilla-common
that referenced
this issue
Nov 11, 2024
This was referenced Nov 11, 2024
krissvaa
added a commit
that referenced
this issue
Nov 13, 2024
Env should be optional for other frameworks Fixes #2867
krissvaa
added a commit
to vaadin/flow
that referenced
this issue
Nov 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Some issues stop endpoints from being called from the Service Worker.
Most of the issues are that
window
ordocument
references are not available in the worker context.Which should be quite easy to solve:
hilla/packages/ts/frontend/src/Connect.ts
Line 21 in c7d4707
hilla/packages/ts/frontend/src/Connect.ts
Line 303 in c7d4707
hilla/packages/ts/frontend/src/CookieManager.ts
Line 8 in c7d4707
Then there are related to the same issue but more complicated issues:
__REGISTER__()
includes references towindow
- but is defined in a different placehttps://github.com/vaadin/hilla/blob/c7d4707995f2235574f48d84a8619ab038beb503/packages/ts/frontend/src/index.ts#L8C1-L8C16
ConnectionState
andConnectionIndicator
from@vaadin/common-frontend
also have references towindow
and need to be either fixed in their repo or clone+fixed in hilla separatelyhilla/packages/ts/frontend/src/Connect.ts
Line 2 in c7d4707
Lastly there is an issue with atmosphere.js and default exports to Vite. Atmosphere dependency could be excluded by SW Vite plugin or by finding a better fix for exclusion as I am not sure about this approach.
Missing CSRF token in calling endpoints is separated in an another issue: #2791
Expected-behavior
All DOM
window
ordocument
references should be prefixed withself.window && window...
orself.document && document...
(or some alternative) so that SW could run without encountering them.Reproduction
sw-app.zip
System Info
Hilla 24.5
The text was updated successfully, but these errors were encountered: