Closed swframe closed 1 month ago
Ill try this and get back to you.
The error seems to be this if I run the browser tests -
Invalid argument(s): Unsupported conditional import of `dart:io` found in huggingface_client|lib/huggingface_client.dart:
import 'dart:io' if (dart.library.html) 'dart:html';
I didn't realise you couldn't conditionally import dart packages, I'll fix this.
This seems to be more a limitation of build_runner than the package itself. The build_runner package does not support conditional inclusion of 'dart:' packages, hence running the test suite on the browser fails. There is a work around for this that I've applied to the package and re released at version 1.2.2.
As far as I can see this shouldn't have stopped the client working in the browser when deployed properly.
When I add the huggingface_client to my test app, executing "flutter run -d chrome" doesn't work. I see the huggingface_client doesn't list web as a supported platform so I'm not surprised. Could you help me understand why it is not possible to support the web platform? I thought the huggingface API is REST so access from a browser should be possible.
Thanks!