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

Flutter Web not working (HttpClient not found) #71

Closed
LDprg opened this issue May 25, 2022 · 2 comments · Fixed by #73
Closed

Flutter Web not working (HttpClient not found) #71

LDprg opened this issue May 25, 2022 · 2 comments · Fixed by #73
Labels
bug Something isn't working urgent 🚨 This issue or feature needs to be worked on urgently

Comments

@LDprg
Copy link

LDprg commented May 25, 2022

Describe the bug
I use your Libary for request/login to my backend. On Windows Desktop and Android everything works fine, but as soon as I want to build my app for Web I get the error shown below.

I tried to use import 'package:universal_io/io.dart'; for fixing it, but That only fixes the HttpClient error not the IOClient.

Please fix!

Error

Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
/C:/Users/LD/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/requests-4.3.0/lib/src/requests.dart:244:22: Error: Method not found: 'HttpClient'.
      var ioClient = HttpClient();
                     ^^^^^^^^^^
/C:/Users/LD/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/requests-4.3.0/lib/src/requests.dart:246:16: Error: Method not found: 'IOClient'.
      client = IOClient(ioClient);
               ^^^^^^^^
Failed to compile application.

To Reproduce
Steps to reproduce the behavior:

  1. Build App with "Chrome(web)" device (Flutter)

Expected behavior
No errors and working build

Desktop

  • Browser (Chrome & Edge) on WIndows
@sehnryr sehnryr added bug Something isn't working urgent 🚨 This issue or feature needs to be worked on urgently labels May 25, 2022
@sehnryr
Copy link
Collaborator

sehnryr commented Jun 3, 2022

It seems like I did not make a great job at adding web support for requests. To get into the details, it's the bad certificate handling that causes this issue. I am currently trying to make it work, but I tried dio and universal_io but couldn't get it running without encountering this issue.

It is still urgent though, but I am overloaded with work so I can't really get into fixing this issue for now. If you find a fix, please open a PR.

@sehnryr
Copy link
Collaborator

sehnryr commented Jun 16, 2022

I've merged your changes on the conditional imports, but I think it would be nice to have the web support shown on pub.dev. I'll try to find a way to do that, but in the meantime we will have to make do with this.

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