resource icon indicating copy to clipboard operation
resource copied to clipboard

Unsupported scheme when using package: uri

Open jimirocks opened this issue 7 years ago • 3 comments

Running the simple test below in dartium gives Unsupported scheme error. Not an expert but it seems the : is unwillingly encoded?

test("broken http scheme", () async {
    var loadInfoText = await new Resource('package:test.txt').readAsString();
    expect(loadInfoText, equals('text'));
  });

for example:

Unsupported operation: Unsupported scheme: http%3A//localhost:43551/mcJCoZomCMCstSKrssXwPq90z9HKv%252B50/test/scanner/packages/test.txt

package:resource/src/io_html.dart 50:3          readAsString.<async>
===== asynchronous gap ===========================
dart:async                                      _Completer.completeError
package:resource/src/io_html.dart 53:1          readAsString.<async>
===== asynchronous gap ===========================
dart:async                                      Future.Future.microtask
package:resource/src/io_html.dart               readAsString
package:resource/src/resource_loader.dart 69:7  DefaultLoader.readAsString
package:resource/src/resource.dart 74:20        Resource.readAsString.<async>
===== asynchronous gap ===========================
dart:async                                      _asyncThenWrapperHelper
package:resource/src/resource.dart              Resource.readAsString
res_test.dart 8:63                              main.<fn>.<async>
===== asynchronous gap ===========================
dart:async                                      Future.Future.microtask
res_test.dart                                   main.<fn>

jimirocks avatar Apr 13 '17 05:04 jimirocks

While debugging, it seems Isolate.resolvePackageUri(uri) is returning this. It looks like a bug in dartium to me.

stijnvanbael avatar Nov 24 '17 14:11 stijnvanbael

Any movement on this issue?

danaoredson-wf avatar Feb 16 '18 16:02 danaoredson-wf

See: https://github.com/flutter/flutter/issues/14815

marcglasberg avatar Dec 18 '18 00:12 marcglasberg