pd4d10 / unpub

Self-hosted private Dart Pub server for Enterprise

Home Page:https://pub.dev/packages/unpub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'String?' is nullable and 'Object' isn't.

Peibalam opened this issue · comments

../../../.pub-cache/hosted/pub.flutter-io.cn/unpub-2.0.0/lib/src/app.dart:113:48: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.

  • 'Object' is from 'dart:core'.
    var server = await shelf_io.serve(handler, host, port);

dart version:Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "macos_x64"

这个问题解决了吗

../../../.pub-cache/hosted/pub.flutter-io.cn/unpub-2.0.0/lib/src/app.dart:113:48: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.

  • 'Object' is from 'dart:core'.
    var server = await shelf_io.serve(handler, host, port);

dart version:Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "macos_x64"

要下载源码修改才行,把String? 改为String

要下载源码修改才行,把String? 改为String

@Peibalam 我把 String? 改了 String 还是会,改成 Object 也会~😓是遗漏了哪一步吗?

  • 研发一番发现问题了:我的根项目和 flutter 目录下的 .pub-cache 存在各自的一份 unpub-2.0.0 源码(个人猜测 dart 、 flutter 命令启动服务有关)。这块需要注意 😓

Thats not really helpful

Here's the current workaround, can run after modifying String? to String on

https://github.com/bytedance/unpub/blob/54742c625d5b4820e353e62be298157c830ebc2f/unpub/bin/unpub.dart#L16

&
https://github.com/bytedance/unpub/blob/54742c625d5b4820e353e62be298157c830ebc2f/unpub/lib/src/app.dart#L103

yes,after i modifying Line 103 from String? to String and delete your .pub-cache un-pub cache.

There is already a pull request: #85