Skip to content

[Bug]: Wrong version.json path when last part of url isn't a folder #2282

Description

@NicolasDionB

Platform

Web 3.10.6

Plugin

package_info_plus

Version

4.1.0

Flutter SDK

3.10.6

Steps to reproduce

I have a Flutter web app that is accessible on a (virtual) url like so: https://myserver.com/application/myapp/access but "access" isn't an actual folder, only a logical name. The actual folder is "myapp". So I get an error when package_info_plus tries to load version.json with the following url: https://myserver.com/application/myapp/access/version.json?cachebuster=... since the file is in "myapp".

The problem seems to be in the logic trying to figure out what the correct url should be. I found a similar bug (#1891) but mine is another variant of the problem.

Code Sample

No response

Logs

html_dart2js.dart:18592     GET `https://myserver.com/application/myapp/access/version.json?cachebuster=1685985905158 404

Flutter Doctor

[!] Flutter (Channel unknown, 3.10.6, on Microsoft Windows [version 10.0.22635.2483], locale fr-CA)
    ! Flutter version 3.10.6 on channel unknown at C:\Tools\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at
      https://flutter.dev/docs/get-started/install.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Framework revision f468f3366c (3 months ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • 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.1)
    • Android SDK at C:\Users\nicolas.dion\AppData\Local\Android\sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[✓] 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.7.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.7.34031.279
    ✗ Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop
      development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[✓] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 17.0.6+0-b2043.56-9586694)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2023.1.5
    • 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

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2023.2
    • 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.82.3)
    • VS Code at C:\Users\nicolas.dion\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.74.0

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [version 10.0.22635.2483]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 118.0.5993.89
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 119.0.2151.12

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

! Doctor found issues in 3 categories.

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions