gpt4 book ai didi

dart - 升级到聚合物后无法运行应用程序:^ 1.0.0-rc.10且可反射(reflect):^ 0.5.0

转载 作者:行者123 更新时间:2023-12-03 02:57:12 24 4
gpt4 key购买 nike

我刚刚升级到聚合物:^ 1.0.0-rc.10,具有可反射的^ 0.5.0的dependecy_overrides。
我观察到,每当我使用上述聚合物和可反射的 Material 升级项目时,都会在输出中得到以下内容

Error on line 1, column 1 of https://pub.dartlang.org/api/packages/initialize: Invalid description: "test_package" is a relative path, but this isn't a local pubspec.
尝试运行我的应用程序失败,并显示以下错误
"P:\Program Files\Dart\dev\dart-sdk\bin\pub.bat" serve web --port=56435
Loading source assets...
Loading web_components, reflectable and test/pub_serve transformers...
Serving epimss_polymer_app web on http://localhost:56435
Build error:
Transform WebComponents on epimss_polymer_app|web/index.html threw error: Class 'LibraryElementImpl' has no instance getter 'node'.

NoSuchMethodError: method not found: 'node'
Receiver: Instance of 'LibraryElementImpl'
Arguments: []
dart:core-patch/object_patch.dart 42 Object._noSuchMethod
dart:core-patch/object_patch.dart 45 Object.noSuchMethod
package:initialize/transformer.dart 240 _BootstrapFileBuilder._readAnnotations
package:initialize/transformer.dart 213 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 193 _BootstrapFileBuilder.run
package:initialize/transformer.dart 35 generateBootstrapFile
package:web_components/build/web_components.dart 32 generateWebComponentsBootstrap
package:web_components/build/web_components.dart 82 WebComponentsTransformer.apply.<fn>.<fn>
dart:async/zone.dart 1149 _RootZone.runUnary
dart:async/future_impl.dart 551 _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 637 _Future._propagateToListeners
dart:async/future_impl.dart 424 _Future._completeWithValue
dart:async/future_impl.dart 479 _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 41 _microtaskLoop
dart:async/schedule_microtask.dart 50 _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 96 _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 149 _RawReceivePortImpl._handleMessage

dart:core Object.noSuchMethod
package:initialize/transformer.dart 240 _BootstrapFileBuilder._readAnnotations
package:initialize/transformer.dart 213 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209 _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 193 _BootstrapFileBuilder.run
package:initialize/transformer.dart 35 generateBootstrapFile
package:web_components/build/web_components.dart 32 generateWebComponentsBootstrap
package:web_components/build/web_components.dart 82 WebComponentsTransformer.apply.<fn>.<fn>
[web] GET index.html => Could not find asset epimss_polymer_app|web/index.html.
[Info from Reflectable on epimss_polymer_app|ReflectableTransformed]:
Ignoring entry point my_project.web.index that does not include the class `Reflectable`.
Build completed with 1 errors.
运行发布缓存修复,但错误仍然存​​在。
请就如何最好地解决此问题提出任何建议。
编辑1
我缩小了由web_component,可反射或聚合物引起的问题。
我用舞台助手创建了一个新的聚合物应用程序,该应用程序可以运行。
新的聚合物应用pubspec.yaml显示如下:
name: 'ui_tester'
version: 0.0.1
description: A web app built using polymer.dart.
#author: Your Name <email@example.com>
#homepage: https://www.example.com

environment:
sdk: '>=1.9.0 <2.0.0'

dependencies:
browser: ^0.10.0
polymer_elements: ^1.0.0-rc.1
polymer: ^1.0.0-rc.10
reflectable: ^0.5.0
# polymer: ^1.0.0-rc.9
# reflectable: ^0.4.0
web_components: ^0.12.1

transformers:
- web_components:
entry_points: web/index.html
- reflectable:
entry_points: web/index.bootstrap.initialize.dart
- $dart2js:
$include: '**/*.bootstrap.initialize.dart'
minify: true
commandLineOptions:
- --trust-type-annotations
- --trust-primitives
只要将依赖关系分别从0.40和1.0.0.rc9(带注释的行)更改为可反射的:0.5.0和聚合物:^ 1.0.0-rc.10(一致的行),问题就会始终如一地再现。
我建议这里可能有一个错误。
我还注意到舞台手现在使用
transformers:
- reflectable:
entry_points: web/index.bootstrap.initialize.dart
代替
transformers:
- reflectable:
entry_points: web/index.dart
这些代码在工作上是否相似?
干杯

最佳答案

更新

当前解决方法
-删除.pub目录
-运行pub upgrade(错误消息仍显示)
-将分析仪限制为0.27.1版本(无0.26.x0.27.1+1版本)

orig

我不确定这是否也是发布问题,因为它与dev_dependency有关。
我在初始化包中创建了https://github.com/dart-lang/initialize/issues/43问题来修复pubspec.yaml

关于dart - 升级到聚合物后无法运行应用程序:^ 1.0.0-rc.10且可反射(reflect):^ 0.5.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34367067/

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