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

The requested built-in library is not available on Dartium.'package:http/src/io_client.dart' #79

Closed
damondouglas opened this issue Apr 24, 2017 · 3 comments

Comments

@damondouglas
Copy link

Version 0.11.3+11 seemed to introduce this error. How I suspect this is described below.

  1. Using stagehand simple-web, I scaffold a simple web application.
  2. I add http: "0.11.3+9" as a dependency and import 'package:http/browser_client.dart';
  3. The following code runs with no error:
main() async {
  var client = new BrowserClient();
  var response =
      await client.get('data.json');
  print('Response status: ${response.statusCode}');
  print('Response body: ${response.body}');
}
  1. Changing dependency to http: "0.11.3+11" and re-running pub get yields the following error in the Dartium console:
The requested built-in library is not available on Dartium.'package:http/src/io_client.dart': error: line 6 pos 1: library handler failed
import 'dart:io';
^: package:http/src/io_client.dart
@zoechi
Copy link

zoechi commented Apr 24, 2017

>=0.11.3+11 uses a new language feature that ignores dart:io imports in the browser.
It looks like you need a newer Dart version

See also the changelog https://pub.dartlang.org/packages/http for 0.11.3+11

@damondouglas
Copy link
Author

The following are the versions of dart and Dartium.

$ dart --version
Dart VM version: 1.23.0 (Fri Apr 21 03:07:31 2017) on "macos_x64"

and Dartium: Version 45.0.2454.104 (64-bit)

Thank you, @zoechi for your help :)

@nex3
Copy link
Member

nex3 commented May 16, 2017

I think you need to update your Dartium version.

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