-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
[web] serviceWorkerVersion is not defined at _getNewServiceWorker #130212
Comments
The error is that the serviceWorkerVersion: '1', |
Thanks for the report and potential fix @p-mazhnik, but I am unable to replicate the error you provided upon running the updated index.html code snippet using latest stable and master versions. I also checked the Chrome's browser console wherein I didn't get the specified error. Are there any missing steps to replicate it properly ? |
@darshankawar hi, here is my |
Thanks for the details. I was able to replicate the error as posted. The error is triggered upon tapping the refresh button from the browser instance and not using the tool (hot restart). stable, master flutter doctor -v
|
@p-mazhnik please, don't do this. There's even a "do not touch the following line" in the index.html warning against doing this :) The current The current approach might change when something like this happens: But for now, if you remove Can you try not deleting it from your index.html, and seeing if the "not defined" error goes away? |
@ditman The only reason I added Also, it is now possible to embed Flutter into existing web app without iframe (thanks for that), so |
You're absolutely right! Let's fix the |
I have a small PR with tests that fixes it: #130206 |
Thanks @p-mazhnik! Let's get it landed! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
flutter#131240) Fixes flutter#130212 Fix `Unresolved variable or type 'serviceWorkerVersion'` in the `_getNewServiceWorker` function. Supersedes flutter#130206
Is there an existing issue for this?
Steps to reproduce
flutter create
.var serviceWorkerVersion = null;
from theindex.html
loadEntrypoint
(index.html
):Installing/Activating first service worker.
message in the Chrome console (Verbose level)Expected results
Message
Loading from existing service worker.
in the console, service worker is loaded.Actual results
Service worker is not loaded with an exception in the console:
Code sample
Code sample
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: