Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watcher crashed for emacs temp file #1134

Closed
alorenzen opened this issue Mar 8, 2018 · 2 comments
Closed

Watcher crashed for emacs temp file #1134

alorenzen opened this issue Mar 8, 2018 · 2 comments

Comments

@alorenzen
Copy link

alorenzen commented Mar 8, 2018

Edited a file in emacs, which created a temporary file, while running build_runner serve, and got the crash listed below:

FormatException: Invalid character (at character 37)
examples.registration_form/address/.#address_component.html
                                    ^

#0      _Uri._fail (dart:core/uri.dart:1597)
#1      _Uri._normalize (dart:core/uri.dart:2292)
#2      _Uri._normalizeOrSubstring (dart:core/uri.dart:2248)
#3      _Uri._makePath (dart:core/uri.dart:2096)
#4      new _Uri (dart:core/uri.dart:1497)
#5      AssetId.uri (package:build/src/asset/id.dart:102:13)
#6      PackageGraphWatcher._watch.<anonymous closure>.<anonymous closure> (package:build_runner/src/watcher/graph_watcher.dart:84:54)
#7      _RootZone.runUnaryGuarded (dart:async/zone.dart:1316)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330)
#9      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:257)
#10     _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:132)
#11     _MapStream._handleData (dart:async/stream_pipe.dart:232)
#12     _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:164)
#13     _RootZone.runUnaryGuarded (dart:async/zone.dart:1316)
#14     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330)
#15     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:257)
#16     _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:379)
#17     _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:254)
#18     _RootZone.runUnaryGuarded (dart:async/zone.dart:1316)
#19     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330)
#20     _DelayedData.perform (dart:async/stream_impl.dart:578)
#21     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:694)
#22     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:654)
#23     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#25     _Timer._runTimers (dart:isolate-patch/dart:isolate/timer_impl.dart:391)
#26     _Timer._handleMessage (dart:isolate-patch/dart:isolate/timer_impl.dart:416)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
@jakemac53
Copy link
Contributor

Geeze, we should possibly just catch any uri.parse error and assume its a garbage file?

@natebosch
Copy link
Member

The stack trace here is in the watcher, we only turn it into a URI for a log.finest (which we ignore anyway) - that one would be easy to fix.

We also have a problem if the file is used in a build. If I create a file named lib/#something.dart then even a build command fails.

natebosch added a commit that referenced this issue Mar 9, 2018
Fixes #1134

Rewrite the URI encoding for AssetId to be more robust by using the
built in URI escaping when using `pathSegments` instead of `path`.

Delete a duplicate of the AssetId test file.
natebosch added a commit that referenced this issue Mar 9, 2018
Fixes #1134

Rewrite the URI encoding for AssetId to be more robust by using the
built in URI escaping when using `pathSegments` instead of `path`.

Delete a duplicate of the AssetId test file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants