Skip to content

[web] serviceWorkerVersion to be const #124783

@asashour

Description

@asashour

Issue

After building for web, there is a warning inindex.html by IntelliJ that 'var' is used instead of 'let' or 'const' in:

var serviceWorkerVersion = "3478168785";

I tried to change the original line from:

var serviceWorkerVersion = null;

to

const serviceWorkerVersion = null;

but it seems that Flutter searches for the whole string.

Proposal

Possibly two things, either:

  1. change the serviceWorkerVersion to a const, I think it is supported.
  2. search for serviceWorkerVersion = null; to replace the value, instead of searching for var serviceWorkerVersion = null;
flutter doctor -v
[!] Flutter (Channel master, 3.10.0-4.0.pre.29, on Microsoft Windows [Version 10.0.19045.2728], locale de-DE)
    • Flutter version 3.10.0-4.0.pre.29 on channel master at C:\use\flutter
    ! Upstream repository https://github.com/asashour/flutter is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://github.com/asashour/flutter to dismiss this error.
    • Framework revision 6509015321 (6 hours ago), 2023-04-13 02:24:22 -0400
    • Engine revision fb3908da9a
    • Dart version 3.0.0 (build 3.0.0-437.0.dev)
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\ahmed_ashour\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_SDK_ROOT = C:\Users\ahmed_ashour\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33213.308
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] IntelliJ IDEA Community Edition (version 2022.3)
    • IntelliJ at C:\Users\ahmed_ashour\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\223.8836.41
    • Flutter plugin version 72.1.4
    • Dart plugin version 223.8888

[√] IntelliJ IDEA Community Edition (version 2023.1)
    • IntelliJ at C:\Users\ahmed_ashour\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\231.8109.175
    • Flutter plugin version 73.0.4
    • Dart plugin version 231.8109.91

[√] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at C:\Users\ahmed_ashour\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\231.8109.175
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.76.0)
    • VS Code at C:\Users\ahmed_ashour\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.60.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2728]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 112.0.5615.87
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 111.0.1661.62

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

platform-webWeb applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions