openai icon indicating copy to clipboard operation
openai copied to clipboard

Build failed | solving by adding imports | Error: Type 'Uint8List' not found. | Error: 'MultipartFile' isn't a type.

Open Stefano-Trinca opened this issue 1 year ago • 0 comments
trafficstars

I have e build failure with the following errors:

    Uint8List? fileData,
    ^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/dart_openai-5.1.0/lib/src/core/networking/client.dart:548:5: Error: 'Uint8List' isn't a type.
    Uint8List? fileData,
    ^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/dart_openai-5.1.0/lib/src/core/networking/client.dart:563:5: Error: 'MultipartFile' isn't a type.
    MultipartFile multiPartFile;
    ^^^^^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/dart_openai-5.1.0/lib/src/instance/audio/audio.dart:52:5: Error: Type 'Uint8List' not found.
    Uint8List? fileData,
    ^^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/dart_openai-5.1.0/lib/src/instance/audio/audio.dart:52:5: Error: 'Uint8List' isn't a type.
    Uint8List? fileData,
    ^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

This can be solved by adding the: import 'dart:typed_data'; on audio.dart and client.dart files.

Then in the client.dart file in the 565 line is missin http. before MultipartFile: http.MultipartFile multiPartFile;

Stefano-Trinca avatar Jun 26 '24 11:06 Stefano-Trinca