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

[URGENT] 4.6.0 breaks building mobile-only apps #81

Closed
imdatceleste opened this issue Sep 26, 2022 · 5 comments · Fixed by #82
Closed

[URGENT] 4.6.0 breaks building mobile-only apps #81

imdatceleste opened this issue Sep 26, 2022 · 5 comments · Fixed by #82
Labels
bug Something isn't working urgent 🚨 This issue or feature needs to be worked on urgently

Comments

@imdatceleste
Copy link
Contributor

Describe the bug
Please check my comment on your last commit.

4.6.0 breaks building for mobile only platforms by unconditionally importing browser_client.dart, which is available only on web

To Reproduce

  1. Create a mobile-only app
  2. Add requests
  3. import requests in main.dart
  4. Try compiling

Expected behavior
Compile

Desktop (please complete the following information):

  • OS: iOS / Android

Smartphone (please complete the following information):

  • N/A

Additional context

  • Please use conditional import
@imdatceleste
Copy link
Contributor Author

imdatceleste commented Sep 26, 2022

Line 4 of src/requests.dart:

import 'package:http/http.dart'
    if (dart.library.html) 'package:http/browser_client.dart'
    if (dart.library.io) 'package:http/io_client.dart';

@sehnryr
Copy link
Collaborator

sehnryr commented Sep 26, 2022

Line 4 of src/requests.dart:

import 'package:http/http.dart'
    if (dart.library.html) 'package:http/browser_client.dart'
    if (dart.library.io) 'package:http/io_client.dart';

This would overwrite the import of http/http.dart.
The easy fix would be to do:

import 'package:http/browser_client.dart' if (dart.library.io) '';

@sehnryr
Copy link
Collaborator

sehnryr commented Sep 26, 2022

While I try to fix the issue, I've retracted the release from pub.dev.

@imdatceleste
Copy link
Contributor Author

Thanks a million...

@sehnryr sehnryr added bug Something isn't working urgent 🚨 This issue or feature needs to be worked on urgently labels Sep 26, 2022
@sehnryr
Copy link
Collaborator

sehnryr commented Sep 26, 2022

I hope the 4.7.0 will not break anything. I've tested it on android, linux and web so it should be ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgent 🚨 This issue or feature needs to be worked on urgently
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants