Flutter Web crashes with Cannot open file client.js

与世无争的帅哥 提交于 2020-12-08 06:33:28

问题


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


回答1:


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

dependencies:
dwds: ^6.0.0

then run command:

flutter update-packages



回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/60768325/flutter-web-crashes-with-cannot-open-file-client-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!