Flutter Web在Chrome运行时加载停滞,构建正常但浏览器报错求助
Flutter Web在Chrome加载卡住的解决办法
关闭Chrome跨域限制:
右键Chrome快捷方式→属性→目标栏末尾添加--disable-web-security --user-data-dir="D:/ChromeTemp"(路径可自定义),重启Chrome后再启动Flutter Web。清理项目缓存并重新构建:
执行以下命令:flutter clean flutter pub get flutter build web完成后用
flutter run -d chrome重新启动。强制使用HTML渲染模式:
启动时添加参数:flutter run -d chrome --web-renderer html或者在
pubspec.yaml中配置默认渲染模式:web: renderer: html禁用Chrome扩展:
关掉所有广告拦截、隐私防护类插件,这类插件大概率会阻断Flutter Web的资源加载。检查网络请求配置:
若项目中有跨域API请求,确保后端已配置CORS允许当前域名访问,或者在本地开发时使用代理转发请求。
内容的提问来源于stack exchange,提问作者Tech Master
相关产品推荐
相关产品推荐

