Flutter Web crashes with Cannot open file client.js

Viewed 2853

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

3 Answers

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

dependencies:
dwds: ^7.1.1

then run command:

flutter update-packages

I was also facing the same issue, I don't know the exact root cause of the problem but I have a hack to make it work.

I was facing the issue after I deleted .pub-cache folder, so from my recycler bin I picked dwds-2.0.1 folder and reverted back. This hack working

add dwds package in your dependencies and run flutter update-packages. It will work :)

Related