Search code examples
flutterflutter-web

Flutter Web crashes with Cannot open file client.js


May I ask your help about this error It's happen when I'm trying for the first time running my flutter web which using flutter run -d chrome

Launching lib\main.dart on Chrome in debug mode...
Syncing files to device Chrome...                                       
25,220ms (!)
GET /dwds/src/injected/client.js
Error thrown by handler.
FileSystemException: Cannot open file, path = 'C:\Users\Acer\flutter\.pub-cache\hosted\pub.dartlang.org\dwds-2.0.1\lib\src\injected\client.js' (OS Error: The system cannot find the path specified.
, errno = 3)
dart:isolate  _RawReceivePortImpl._handleMessage

And if I trying run using

flutter run -d web

It's doesn't thrown any error but on the website it goes blank white nothing shown up. Anyway thanks for your help


Solution

  • adding the following in the pubspec.yaml worked for me. I am using beta channel.

    dependencies:
    dwds: ^16.0.1
    

    then run command:

    flutter update-packages