dart-lang / shelf

Web server middleware for Dart
https://pub.dev/packages/shelf
BSD 3-Clause "New" or "Revised" License
921 stars 124 forks source link

Invalid argument(s): A directory corresponding to fileSystemPath #396

Open tenraneko opened 9 months ago

tenraneko commented 9 months ago

Hi guys! Am I doing something wrong?

Code in lib\screens\create_server\create_server_screen.dart

final staticHandler = createStaticHandler('assets/web', defaultDocument: 'index.html');

pubspec.yaml

  assets:
    - assets/web/

DIrectory exists

image

and still I get the error

Unhandled Exception: Invalid argument(s): A directory corresponding to fileSystemPath "assets/web" could not be found

Please tell me what I'm doing wrong

Flutter doctor

result [√] Flutter (Channel stable, 3.16.3, on Microsoft Windows [Version 10.0.22000.2538], locale en-US) • Flutter version 3.16.3 on channel stable at C:\FlutterSDK • Upstream repository https://github.com/flutter/flutter.git • Framework revision b0366e0a3f (5 days ago), 2023-12-05 19:46:39 -0800 • Engine revision 54a7145303 • Dart version 3.2.3 • DevTools version 2.28.4 [√] 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\user\AppData\Local\Android\sdk • Platform android-34, build-tools 33.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.17) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools • Visual Studio Build Tools 2019 version 16.11.32630.194 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 2022.3) • 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-10027231) [√] VS Code (version 1.85.0) • VS Code at C:\Users\user\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.78.0 [√] Connected device (4 available) • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.2538] • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.71 • Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.61 [√] Network resources • All expected network resources are available. • No issues found!