gpt4 book ai didi

flutter-web - Flutter web - 不支持的操作 : InternetAddress. LOOPBACK_IP_V4

转载 作者:行者123 更新时间:2023-12-04 11:36:20 27 4
gpt4 key购买 nike

我想尝试一下 flutter HttpServer 库,但一开始就卡住了。

import 'dart:io';

void main() async {
var server = await HttpServer.bind(InternetAddress.loopbackIPv4, 8080);
}

继续以下异常:
Error: Unsupported operation: InternetAddress.LOOPBACK_IP_V4
at Object.throw_ [as throw] (http://localhost:43203/dart_sdk.js:4040:11)
at Function.get LOOPBACK_IP_V4 [as LOOPBACK_IP_V4] (http://localhost:43203/dart_sdk.js:59789:17)
at Function.get loopbackIPv4 [as loopbackIPv4] (http://localhost:43203/dart_sdk.js:59786:33)
at main (http://localhost:43203/packages/dolphin/main.dart.lib.js:13:68)
at main.next (<anonymous>)
at runBody (http://localhost:43203/dart_sdk.js:41692:34)
at Object._async [as async] (http://localhost:43203/dart_sdk.js:41720:7)
at Object.main$ [as main] (http://localhost:43203/packages/dolphin/main.dart.lib.js:12:18)
at main$ (http://localhost:43203/web_entrypoint.dart.lib.js:14:12)
at main$.next (<anonymous>)
at onValue (http://localhost:43203/dart_sdk.js:41673:33)
at _RootZone.runUnary (http://localhost:43203/dart_sdk.js:41558:58)
at _FutureListener.thenAwait.handleValue (http://localhost:43203/dart_sdk.js:37044:29)
at handleValueCallback (http://localhost:43203/dart_sdk.js:37545:49)
at Function._propagateToListeners (http://localhost:43203/dart_sdk.js:37577:17)
at async._AsyncCallbackEntry.new.callback (http://localhost:43203/dart_sdk.js:37333:27)
at Object._microtaskLoop (http://localhost:43203/dart_sdk.js:41774:13)
at _startMicrotaskLoop (http://localhost:43203/dart_sdk.js:41780:13)
at http://localhost:43203/dart_sdk.js:37782:9

颤振版本:
Flutter 1.17.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision d3ed9ec945 (vor 2 Wochen) • 2020-04-06 14:07:34 -0700
Engine • revision c9506cb8e9
Tools • Dart 2.8.0 (build 2.8.0-dev.18.0 eea9717938)

操作系统:
  Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-8-amd64
Architecture: x86-64

如果有人可以帮助我/知道我的错误是什么,那就太棒了。谢谢 :)

最佳答案

import 'dart:io';
flutter web.issue 链接不支持 https://github.com/flutter/flutter/issues/39998

关于flutter-web - Flutter web - 不支持的操作 : InternetAddress. LOOPBACK_IP_V4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61321598/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com