将 dart 升级到 2.7 时 webdev 出错
error in webdev while upgrading dart to 2.7
我正在尝试将 Web 应用程序从 2.52 迁移到 2.7,但是,在没有太多信息的情况下抛出了很多错误。
问题好像升级了build_runner和build_web_compilers.
从 2.6 开始,它必须使用 dill 文件进行编译,而这种编译方式不适用于我的项目。
网络开发版本:2.5.4
这是日志:
MacBook-Pro-de-Jonathan-941:guaraci jonathanrezende$ dart --version
Dart VM version: 2.7.0 (Fri Dec 6 16:26:51 2019 +0100) on "macos_x64"
MacBook-Pro-de-Jonathan-941:guaraci jonathanrezende$ webdev --version
2.5.4
MacBook-Pro-de-Jonathan-941:guaraci jonathanrezende$ sudo webdev serve web:80 --hostname guara.ci
[INFO] Building new asset graph completed, took 3.8s
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[INFO] Serving `web` on http://guara.ci
[INFO] Generating SDK summary completed, took 3.5s
[SEVERE]build_web_compilers:ddc on package:oni_services_components/src/communication_message.ddc.module: Error compiling dartdevc module:oni_services_components|lib/src/communication_message.ddc.js
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/oni_forms.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/oni_forms.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/base.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/base.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/base.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/batch_form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/batch_form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/base.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/base.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/editor.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/editor.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/editor.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/error.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/footer.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/footer.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/footer.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/form.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/group.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/group.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/object_form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/object_form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/paginated_form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/paginated_form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/submit.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/submit.template.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/oni_objector.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/oni_objector.template.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/field_desc.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/field_desc.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/field_desc.template.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/object.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/object.template.dart'.
[WARNING]build_web_compilers:entrypoint on web/main.dart: Unable to read oni_services_components|lib/src/communication_message.ddc.js, check your console or the `.dart_tool/build/generated/oni_services_components/lib/src/communication_message.ddc.js.errors` log file.
[SEVERE]build_web_compilers:ddc on package:oni_inputs/oni_inputs.template.ddc.module: Error creating oni_inputs|lib/oni_inputs.template.ddc.dillError creating kernel summary for module:oni_inputs|lib/oni_inputs.template.ddc.dill
Response:--dart-sdk-summary=file:///Users/jonathanrezende/Dart/current/lib/_internal/ddc_sdk.dill --output=/private/tmp/scratch_spacenF5cNh/packages/oni_inputs/oni_inputs.template.ddc.dill --packages-file=file:///tmp/kernel_builder_jpDCb2/.packages --multi-root-scheme=org-dartlang-app --exclude-non-sources --summary-only --target=ddc --libraries-file=file:///Users/jonathanrezende/Dart/current/lib/libraries.json --reuse-compiler-result --use-incremental-compiler --used-inputs=/tmp/kernel_builder_FBcKpI/used_inputs.txt --input-summary=org-dartlang-app:///packages/angular/src/bootstrap/modules.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/id_generator/id_generator.ddc.dill --input-summary=org-dartlang-app:///packages/oni_front_common/oni_front_common.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_input_default_value_accessor.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/laminate/components/modal/modal.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/runtime/proxies.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_input.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/dynamic_component/dynamic_component.template.ddc.dill --input-summary=org-dartlang-app:///packages/oni_common/oni_common.ddc.dill --input-summary=org-dartlang-app:///packages/oni_front_common/src/config.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/angular_components.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_auto_suggest_input.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/base_material_input.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/runtime/queries.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_select/material_select.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/runtime/text_binding.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/focus/focus.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/src/material_tooltip/tooltip_controller.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/angular/reference/reference.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/browser/dom_service/dom_service.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/model/selection/selection_container.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/interfaces/has_disabled.ddc.dill --input-summary=org-dartlang-app:///packages/oni_services/src/action.ddc.dill --input-summary=org-dartlang-app:///packages/angular/angular.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/mixins/material_dropdown_base.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_auto_suggest_input.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/deferred_validator.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/src/laminate/popup/popup_hierarchy.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/disposer/disposer.ddc.dill --input-summary=org-dartlang-app:///packages/angular_forms/src/directives.ddc.dill --input-summary=org-dartlang-app:///packages/angular/angular.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/core/change_detection/change_detection.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/model/ui/
您在 .packages 文件中看到 oni_forms
了吗?这看起来你得到了一些缺少依赖项的包的新版本,而不是 build_web_compilers 问题。
发现了。
是深度相关包之间的循环依赖。
我猜旧的 DDC 让这种情况发生了,因为即使认为包是循环的,但文件不是。
现在,莳萝的东西不会让这种情况发生在包级别。
我正在尝试将 Web 应用程序从 2.52 迁移到 2.7,但是,在没有太多信息的情况下抛出了很多错误。
问题好像升级了build_runner和build_web_compilers.
从 2.6 开始,它必须使用 dill 文件进行编译,而这种编译方式不适用于我的项目。
网络开发版本:2.5.4
这是日志:
MacBook-Pro-de-Jonathan-941:guaraci jonathanrezende$ dart --version
Dart VM version: 2.7.0 (Fri Dec 6 16:26:51 2019 +0100) on "macos_x64"
MacBook-Pro-de-Jonathan-941:guaraci jonathanrezende$ webdev --version
2.5.4
MacBook-Pro-de-Jonathan-941:guaraci jonathanrezende$ sudo webdev serve web:80 --hostname guara.ci
[INFO] Building new asset graph completed, took 3.8s
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[INFO] Serving `web` on http://guara.ci
[INFO] Generating SDK summary completed, took 3.5s
[SEVERE]build_web_compilers:ddc on package:oni_services_components/src/communication_message.ddc.module: Error compiling dartdevc module:oni_services_components|lib/src/communication_message.ddc.js
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/oni_forms.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/oni_forms.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/base.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/base.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/base.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/batch_form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/batch_form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/base.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/base.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/editor.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/editor.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/editor/editor.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/error.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/footer.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/footer.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/footer.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/form.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/group.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/group.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/object_form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/object_form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/paginated_form.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/paginated_form.template.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/submit.dart'.
Error: Could not resolve the package 'oni_forms' in 'package:oni_forms/src/submit.template.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/oni_objector.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/oni_objector.template.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/field_desc.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/field_desc.scss.css.shim.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/field_desc.template.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/object.dart'.
Error: Could not resolve the package 'oni_objector' in 'package:oni_objector/src/object.template.dart'.
[WARNING]build_web_compilers:entrypoint on web/main.dart: Unable to read oni_services_components|lib/src/communication_message.ddc.js, check your console or the `.dart_tool/build/generated/oni_services_components/lib/src/communication_message.ddc.js.errors` log file.
[SEVERE]build_web_compilers:ddc on package:oni_inputs/oni_inputs.template.ddc.module: Error creating oni_inputs|lib/oni_inputs.template.ddc.dillError creating kernel summary for module:oni_inputs|lib/oni_inputs.template.ddc.dill
Response:--dart-sdk-summary=file:///Users/jonathanrezende/Dart/current/lib/_internal/ddc_sdk.dill --output=/private/tmp/scratch_spacenF5cNh/packages/oni_inputs/oni_inputs.template.ddc.dill --packages-file=file:///tmp/kernel_builder_jpDCb2/.packages --multi-root-scheme=org-dartlang-app --exclude-non-sources --summary-only --target=ddc --libraries-file=file:///Users/jonathanrezende/Dart/current/lib/libraries.json --reuse-compiler-result --use-incremental-compiler --used-inputs=/tmp/kernel_builder_FBcKpI/used_inputs.txt --input-summary=org-dartlang-app:///packages/angular/src/bootstrap/modules.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/id_generator/id_generator.ddc.dill --input-summary=org-dartlang-app:///packages/oni_front_common/oni_front_common.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_input_default_value_accessor.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/laminate/components/modal/modal.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/runtime/proxies.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_input.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/dynamic_component/dynamic_component.template.ddc.dill --input-summary=org-dartlang-app:///packages/oni_common/oni_common.ddc.dill --input-summary=org-dartlang-app:///packages/oni_front_common/src/config.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/angular_components.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_auto_suggest_input.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/base_material_input.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/runtime/queries.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_select/material_select.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/runtime/text_binding.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/focus/focus.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/src/material_tooltip/tooltip_controller.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/angular/reference/reference.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/browser/dom_service/dom_service.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/model/selection/selection_container.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/interfaces/has_disabled.ddc.dill --input-summary=org-dartlang-app:///packages/oni_services/src/action.ddc.dill --input-summary=org-dartlang-app:///packages/angular/angular.template.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/mixins/material_dropdown_base.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/material_auto_suggest_input.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/material_input/deferred_validator.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/src/laminate/popup/popup_hierarchy.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/utils/disposer/disposer.ddc.dill --input-summary=org-dartlang-app:///packages/angular_forms/src/directives.ddc.dill --input-summary=org-dartlang-app:///packages/angular/angular.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/core/change_detection/change_detection.ddc.dill --input-summary=org-dartlang-app:///packages/angular_components/model/ui/
您在 .packages 文件中看到 oni_forms
了吗?这看起来你得到了一些缺少依赖项的包的新版本,而不是 build_web_compilers 问题。
发现了。 是深度相关包之间的循环依赖。
我猜旧的 DDC 让这种情况发生了,因为即使认为包是循环的,但文件不是。 现在,莳萝的东西不会让这种情况发生在包级别。