refi64 / vuedart

Create Vue web apps in Dart
https://refi64.com/vuedart
310 stars 19 forks source link

Support Dart 2.5 Envs? #43

Open hjianjie opened 5 years ago

hjianjie commented 5 years ago

Hi,My development environment is as follows: Dart:2.5.2 OS:Windows pubspec.yaml

name: my_project
description: An absolute bare-bones web app.

environment:
  sdk: '>=2.5.0 <3.0.0'

dependencies:
  vue: ^0.4.2
  http: any
  cooky: any
  js: ^0.6.1+1
  event_bus: ^1.1.0

dev_dependencies:
  build_runner: ^1.6.0
  build_web_compilers: ^2.3.0
  #pedantic: ^1.8.0

When I Create a VueComponent, Follows:

@VueComponent(template: '<<')
class SoLogin extends VueComponentBase {

}

Then Terminal Displays an Error:**

[INFO] -----------------------------------------------------------------------------------------------------------------------------------------------------
[INFO] Updating asset graph completed, took 1ms
[INFO] Running build completed, took 106ms
[INFO] Caching finalized dependency graph completed, took 145ms
[SEVERE]vue:vue on web/index.dart (cached): RangeError: Offset may not be negative, was -1.

[SEVERE] Failed after 256ms

Please,Can you help me ?

hjianjie commented 5 years ago
webdev serve -v
[INFO] Connecting to the build daemon...
[INFO] Generating build script...
[INFO] Generating build script completed, took 400ms
[INFO]
[INFO] Starting daemon...
[INFO]BuildDefinition: Initializing inputs
[INFO]BuildDefinition: Reading cached asset graph...
[INFO]BuildDefinition: Reading cached asset graph completed, took 274ms

[INFO]BuildDefinition: Checking for updates since last build...
[INFO]BuildDefinition: Checking for updates since last build completed, took 1.1s

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 274ms
[INFO]
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.1s
[INFO]
[INFO] Setting up file watchers...
[INFO] Setting up file watchers completed, took 3ms
[INFO]
[INFO] Registering build targets...
[INFO] Starting initial build...
[INFO] Starting resource servers...
[INFO] Serving `web` on http://127.0.0.1:8080

[INFO] About to build [web]...
[INFO]Build: Running build...
[INFO]Build: Running build completed, took 342ms

[INFO]Build: Caching finalized dependency graph...
[INFO]Build: Caching finalized dependency graph completed, took 187ms

[SEVERE]vue:vue on web/index.dart (cached): RangeError: Offset may not be negative, was -1.
#0      new FileLocation._ (package:source_span/src/file.dart:237:7)
#1      SourceFile.location (package:source_span/src/file.dart:96:44)
#2      TextEditTransaction.commit (package:source_maps/refactor.dart:61:24)
#3      VuedartBuildContext.build (package:vue/builders.dart:592:28)
<asynchronous suspension>
#4      _VuedartBuilder.build (package:vue/builders.dart:615:62)
<asynchronous suspension>
#5      runBuilder.buildForInput (package:build/src/generate/run_builder.dart:55:21)
<asynchronous suspension>
#6      MappedListIterable.elementAt (dart:_internal/iterable.dart:415:29)
#7      ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
#8      Future.wait (dart:async/future.dart:393:26)
#9      runBuilder.<anonymous closure> (package:build/src/generate/run_builder.dart:61:36)
#10     _rootRun (dart:async/zone.dart:1124:13)
#11     _CustomZone.run (dart:async/zone.dart:1021:19)
#12     _runZoned (dart:async/zone.dart:1516:10)
#13     runZoned (dart:async/zone.dart:1500:12)
#14     scopeLogAsync (package:build/src/builder/logging.dart:22:3)
#15     runBuilder (package:build/src/generate/run_builder.dart:61:9)
<asynchronous suspension>
#16     _SingleBuild._runForInput.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:478:19)#17     _NoOpBuilderActionTracker.trackStage (package:build_runner_core/src/generate/performance_tracker.dart:300:15)
#18     _SingleBuild._runForInput.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:476:23)
<asynchronous suspension>
#19     NoOpTimeTracker.track (package:timing/src/timing.dart:222:44)
#20     _SingleBuild._runForInput.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:434:22)
#21     Pool.withResource (package:pool/pool.dart:127:28)
<asynchronous suspension>
#22     _SingleBuild._runForInput (package:build_runner_core/src/generate/build_impl.dart:430:17)
#23     _SingleBuild._runBuilder.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:378:38)
#24     MappedIterator.moveNext (dart:_internal/iterable.dart:393:18)
#25     Future.wait (dart:async/future.dart:393:26)
#26     _SingleBuild._runBuilder (package:build_runner_core/src/generate/build_impl.dart:377:36)
<asynchronous suspension>
#27     _SingleBuild._runPhases.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:323:20)
<asynchronous suspension>
#28     _NoOpBuildPerformanceTracker.trackBuildPhase (package:build_runner_core/src/generate/performance_tracker.dart:184:15)
#29     _SingleBuild._runPhases.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:319:47)
<asynchronous suspension>
#30     NoOpTimeTracker.track (package:timing/src/timing.dart:222:44)
#31     _SingleBuild._runPhases (package:build_runner_core/src/generate/build_impl.dart:313:32)
#32     logTimedAsync (package:build_runner_core/src/logging/logging.dart:25:30)
<asynchronous suspension>
#33     _SingleBuild._safeBuild.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:270:26)
<asynchronous suspension>
#34     _rootRun (dart:async/zone.dart:1124:13)
#35     _CustomZone.run (dart:async/zone.dart:1021:19)
#36     _runZoned (dart:async/zone.dart:1516:10)
#37     runZoned (dart:async/zone.dart:1500:12)
#38     _SingleBuild._safeBuild (package:build_runner_core/src/generate/build_impl.dart:265:5)
#39     _SingleBuild.run (package:build_runner_core/src/generate/build_impl.dart:212:24)
<asynchronous suspension>
#40     BuildImpl.run (package:build_runner_core/src/generate/build_impl.dart:97:56)
#41     BuildRunnerDaemonBuilder.build (package:build_runner/src/daemon/daemon_builder.dart:112:35)
<asynchronous suspension>
#42     Server._build.<anonymous closure> (package:build_daemon/src/server.dart:122:25)
#43     Pool.withResource (package:pool/pool.dart:127:28)
<asynchronous suspension>
#44     Server._build (package:build_daemon/src/server.dart:119:13)
#45     Server._handleChanges.<anonymous closure> (package:build_daemon/src/server.dart:148:13)
<asynchronous suspension>
#46     _asyncMapThen.<anonymous closure> (package:stream_transform/src/async_map_buffer.dart:76:16)
#47     _StreamTransformer.bind.<anonymous closure>.<anonymous closure> (package:stream_transform/src/from_handlers.dart:59:47)
#48     _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#49     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#50     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#51     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#52     _StreamController._add (dart:async/stream_controller.dart:640:7)
#53     _StreamController.add (dart:async/stream_controller.dart:586:5)
#54     AggregateSample.bind.emit (package:stream_transform/src/aggregate_sample.dart:36:18)
#55     AggregateSample.bind.onValue (package:stream_transform/src/aggregate_sample.dart:44:35)
#56     _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#57     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#58     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#59     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#60     _StreamController._add (dart:async/stream_controller.dart:640:7)
#61     _StreamController.add (dart:async/stream_controller.dart:586:5)
#62     _debounceAggregate.<anonymous closure>.<anonymous closure> (package:stream_transform/src/debounce.dart:43:12)
#63     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
#64     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
#65     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#66     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
wbdsnx commented 5 years ago

Have you solved?

wbdsnx commented 5 years ago
webdev serve -v
[INFO] Connecting to the build daemon...
[INFO] Generating build script...
[INFO] Generating build script completed, took 400ms
[INFO]
[INFO] Starting daemon...
[INFO]BuildDefinition: Initializing inputs
[INFO]BuildDefinition: Reading cached asset graph...
[INFO]BuildDefinition: Reading cached asset graph completed, took 274ms

[INFO]BuildDefinition: Checking for updates since last build...
[INFO]BuildDefinition: Checking for updates since last build completed, took 1.1s

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 274ms
[INFO]
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.1s
[INFO]
[INFO] Setting up file watchers...
[INFO] Setting up file watchers completed, took 3ms
[INFO]
[INFO] Registering build targets...
[INFO] Starting initial build...
[INFO] Starting resource servers...
[INFO] Serving `web` on http://127.0.0.1:8080

[INFO] About to build [web]...
[INFO]Build: Running build...
[INFO]Build: Running build completed, took 342ms

[INFO]Build: Caching finalized dependency graph...
[INFO]Build: Caching finalized dependency graph completed, took 187ms

[SEVERE]vue:vue on web/index.dart (cached): RangeError: Offset may not be negative, was -1.
#0      new FileLocation._ (package:source_span/src/file.dart:237:7)
#1      SourceFile.location (package:source_span/src/file.dart:96:44)
#2      TextEditTransaction.commit (package:source_maps/refactor.dart:61:24)
#3      VuedartBuildContext.build (package:vue/builders.dart:592:28)
<asynchronous suspension>
#4      _VuedartBuilder.build (package:vue/builders.dart:615:62)
<asynchronous suspension>
#5      runBuilder.buildForInput (package:build/src/generate/run_builder.dart:55:21)
<asynchronous suspension>
#6      MappedListIterable.elementAt (dart:_internal/iterable.dart:415:29)
#7      ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
#8      Future.wait (dart:async/future.dart:393:26)
#9      runBuilder.<anonymous closure> (package:build/src/generate/run_builder.dart:61:36)
#10     _rootRun (dart:async/zone.dart:1124:13)
#11     _CustomZone.run (dart:async/zone.dart:1021:19)
#12     _runZoned (dart:async/zone.dart:1516:10)
#13     runZoned (dart:async/zone.dart:1500:12)
#14     scopeLogAsync (package:build/src/builder/logging.dart:22:3)
#15     runBuilder (package:build/src/generate/run_builder.dart:61:9)
<asynchronous suspension>
#16     _SingleBuild._runForInput.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:478:19)#17     _NoOpBuilderActionTracker.trackStage (package:build_runner_core/src/generate/performance_tracker.dart:300:15)
#18     _SingleBuild._runForInput.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:476:23)
<asynchronous suspension>
#19     NoOpTimeTracker.track (package:timing/src/timing.dart:222:44)
#20     _SingleBuild._runForInput.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:434:22)
#21     Pool.withResource (package:pool/pool.dart:127:28)
<asynchronous suspension>
#22     _SingleBuild._runForInput (package:build_runner_core/src/generate/build_impl.dart:430:17)
#23     _SingleBuild._runBuilder.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:378:38)
#24     MappedIterator.moveNext (dart:_internal/iterable.dart:393:18)
#25     Future.wait (dart:async/future.dart:393:26)
#26     _SingleBuild._runBuilder (package:build_runner_core/src/generate/build_impl.dart:377:36)
<asynchronous suspension>
#27     _SingleBuild._runPhases.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:323:20)
<asynchronous suspension>
#28     _NoOpBuildPerformanceTracker.trackBuildPhase (package:build_runner_core/src/generate/performance_tracker.dart:184:15)
#29     _SingleBuild._runPhases.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:319:47)
<asynchronous suspension>
#30     NoOpTimeTracker.track (package:timing/src/timing.dart:222:44)
#31     _SingleBuild._runPhases (package:build_runner_core/src/generate/build_impl.dart:313:32)
#32     logTimedAsync (package:build_runner_core/src/logging/logging.dart:25:30)
<asynchronous suspension>
#33     _SingleBuild._safeBuild.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:270:26)
<asynchronous suspension>
#34     _rootRun (dart:async/zone.dart:1124:13)
#35     _CustomZone.run (dart:async/zone.dart:1021:19)
#36     _runZoned (dart:async/zone.dart:1516:10)
#37     runZoned (dart:async/zone.dart:1500:12)
#38     _SingleBuild._safeBuild (package:build_runner_core/src/generate/build_impl.dart:265:5)
#39     _SingleBuild.run (package:build_runner_core/src/generate/build_impl.dart:212:24)
<asynchronous suspension>
#40     BuildImpl.run (package:build_runner_core/src/generate/build_impl.dart:97:56)
#41     BuildRunnerDaemonBuilder.build (package:build_runner/src/daemon/daemon_builder.dart:112:35)
<asynchronous suspension>
#42     Server._build.<anonymous closure> (package:build_daemon/src/server.dart:122:25)
#43     Pool.withResource (package:pool/pool.dart:127:28)
<asynchronous suspension>
#44     Server._build (package:build_daemon/src/server.dart:119:13)
#45     Server._handleChanges.<anonymous closure> (package:build_daemon/src/server.dart:148:13)
<asynchronous suspension>
#46     _asyncMapThen.<anonymous closure> (package:stream_transform/src/async_map_buffer.dart:76:16)
#47     _StreamTransformer.bind.<anonymous closure>.<anonymous closure> (package:stream_transform/src/from_handlers.dart:59:47)
#48     _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#49     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#50     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#51     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#52     _StreamController._add (dart:async/stream_controller.dart:640:7)
#53     _StreamController.add (dart:async/stream_controller.dart:586:5)
#54     AggregateSample.bind.emit (package:stream_transform/src/aggregate_sample.dart:36:18)
#55     AggregateSample.bind.onValue (package:stream_transform/src/aggregate_sample.dart:44:35)
#56     _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#57     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#58     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#59     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#60     _StreamController._add (dart:async/stream_controller.dart:640:7)
#61     _StreamController.add (dart:async/stream_controller.dart:586:5)
#62     _debounceAggregate.<anonymous closure>.<anonymous closure> (package:stream_transform/src/debounce.dart:43:12)
#63     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
#64     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
#65     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#66     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

How can I fix it? Have you fixed it?

refi64 commented 5 years ago

Sorry for the delay, this will be fixed by this weekend.

hjianjie commented 5 years ago

Thank you

发自我的iPhone

------------------ Original ------------------ From: Ryan Gonzalez <notifications@github.com> Date: Thu,Nov 7,2019 1:03 PM To: refi64/vuedart <vuedart@noreply.github.com> Cc: hjianjie <50867104@qq.com>, Author <author@noreply.github.com> Subject: Re: [refi64/vuedart] Support Dart 2.5 Envs? (#43)

Sorry for the delay, this will be fixed by this weekend.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

refi64 commented 5 years ago

Hmm I can't seem to reproduce this at all. Could one of @hjianjie or @wbdsnx upload a full ZIP file of the project, containing the pubspec.yaml, the Dart sources, HTML templates, and the pubspec.lock? (FWIW I'm testing this on Dart 2.6.)

richard-fairthorne commented 4 years ago

I also have this problem today under dart 2.7.0 2019-12-23 19_52_10-Window . It exists with the project created by:

vuedart create myproj

2019-12-23 19_45_44-Window

I have been experimenting and can make the project work, but cannot use vue components.

It succeeds if I comment out the VueComponent annotation, but it is not useful without VueComponent annotations.

2019-12-23 19_47_52-Window

2019-12-23 19_52_10-Window

incu6us commented 4 years ago

Hi! Got the same. Steps to reproduce:

vuedart create project_ui

Creating project_ui...
Writing README.md...
Writing analysis_options.yaml...
Writing pubspec.yaml...
Writing web/index.html...
Writing web/index.dart...
Writing lib/my_component.html...
Writing lib/my_component.dart...
Done!

pub get

Resolving dependencies... (13.7s)
+ analyzer 0.38.5 (0.39.4 available)
+ archive 2.0.13
+ args 1.6.0
+ async 2.4.1
+ bazel_worker 0.1.23+1
+ build 1.2.2
+ build_config 0.4.2
+ build_daemon 2.1.4
+ build_modules 2.8.1 (2.9.0 available)
+ build_resolvers 1.2.1 (1.3.3 available)
+ build_runner 1.8.0
+ build_runner_core 4.5.3
+ build_web_compilers 2.9.0 (2.10.0 available)
+ built_collection 4.3.2
+ built_value 7.0.9
+ charcode 1.1.3
+ checked_yaml 1.0.2
+ cli_repl 0.2.0+1
+ code_builder 3.2.1
+ collection 1.14.12
+ convert 2.1.1
+ crypto 2.1.4
+ csslib 0.14.6+1 (0.16.1 available)
+ dart_style 1.3.3
+ fixnum 0.10.11
+ front_end 0.1.27 (0.1.29 available)
+ glob 1.2.0
+ graphs 0.2.0
+ html 0.13.4+2 (0.14.0+3 available)
+ http 0.12.0+4
+ http_multi_server 2.2.0
+ http_parser 3.1.4
+ io 0.3.3
+ js 0.6.1+1
+ json_annotation 3.0.1
+ kernel 0.3.27 (0.3.29 available)
+ logging 0.11.4
+ matcher 0.12.6
+ meta 1.1.8
+ mime 0.9.6+3
+ node_interop 1.0.3
+ node_io 1.0.1+2
+ package_config 1.9.3
+ package_resolver 1.0.10
+ path 1.6.4
+ pedantic 1.9.0
+ pool 1.4.0
+ protobuf 1.0.1
+ pub_semver 1.4.4
+ pubspec_parse 0.1.5
+ quiver 2.1.3
+ sass 1.26.3
+ sass_builder 2.1.3
+ scopify 0.2.2
+ scratch_space 0.0.4+2
+ shelf 0.7.5
+ shelf_web_socket 0.2.3
+ source_maps 0.10.9
+ source_span 1.7.0
+ stack_trace 1.9.3
+ stream_channel 2.0.0
+ stream_transform 1.2.0
+ string_scanner 1.0.5
+ term_glyph 1.1.0
+ timing 0.1.1+2
+ tuple 1.0.3
+ typed_data 1.1.6
+ utf 0.9.0+5
+ uuid 1.0.3 (2.0.4 available)
+ vue 0.4.2
+ watcher 0.9.7+14
+ web_socket_channel 1.1.0
+ yaml 2.2.0
Changed 73 dependencies!
Precompiling executables... ^[[A^[[A(11.9s)
Precompiled build_runner:graph_inspector.
Precompiled build_runner:build_runner.

webdev serve

[INFO] Building new asset graph completed, took 1.1s
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[INFO] Serving `web` on http://127.0.0.1:8080
[INFO] Generating SDK summary completed, took 2.7s
[SEVERE]vue:vue on web/index.dart: RangeError: Offset may not be negative, was -1.

[INFO] Running build completed, took 7.6s
[INFO] Caching finalized dependency graph completed, took 120ms
[SEVERE] Failed after 7.8s
[INFO] -------------------------------------

dart --version

Dart VM version: 2.7.2 (Mon Mar 23 22:11:27 2020 +0100) on "macos_x64"
incu6us commented 4 years ago

Probably the solution is to update the package in pub repository. I've pulled the source code from master locally and override the dependency with it and there are no errors for now. Web page(http://127.0.0.1:8080) is also accessible

pubspec.yaml

dependencies:
  vue: ^0.4.2
dependency_overrides:
  vue:
    path: ../vuedart/vue
...

webdev serve

[INFO] Reading cached asset graph completed, took 193ms
[INFO] Checking for updates since last build completed, took 664ms
[WARNING] Invalidating asset graph due package config update!
[WARNING] Invalidating asset graph due to build script update!
[INFO] Cleaning up outputs from previous builds. completed, took 113ms
[INFO] Building new asset graph completed, took 1.0s
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[INFO] Serving `web` on http://127.0.0.1:8080
[INFO] Running build completed, took 5.8s
[INFO] Caching finalized dependency graph completed, took 119ms
[INFO] Succeeded after 5.9s with 1232 outputs (4181 actions)
[INFO] -------------------------------------