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

Web:Uncaught Unsupported operation: Platform._operatingSystem #1484

Open
1 task done
mokanus opened this issue Apr 9, 2024 · 3 comments
Open
1 task done

Web:Uncaught Unsupported operation: Platform._operatingSystem #1484

mokanus opened this issue Apr 9, 2024 · 3 comments
Assignees
Labels
feature-candidate This issue might result in a feature to be implemented web Issue applies to Web platform

Comments

@mokanus
Copy link

mokanus commented Apr 9, 2024

Describe the bug
The local operation is perfect, and when I use Flutter run -- release, it is also possible. However, when deploying and accessing Flutter build web, errors may occur

Platform

  • Web

Platform OS version
MacOS:14.2.1 (23C71)
Chrome: 123.0.6312.87(正式版本) (x86_64)

How are you picking?
I just trigger by one button.Just like:
image
then:
image

After testing this logic, I found an error occurring in the part where the file retrieval is opened, which is the location shown in my screenshot. The issue is that when I click the button, there is no response, and the console displays this error log.

Error:
main.dart.js:5168 Uncaught Unsupported operation: Platform._operatingSystem
at Object.c (http://38.47.108.163/main.dart.js:5168:19)
at Object.b00 (http://38.47.108.163/main.dart.js:9314:15)
at Object.b01 (http://38.47.108.163/main.dart.js:9346:16)
at http://38.47.108.163/main.dart.js:106263:22
at a. [as yG] (http://38.47.108.163/main.dart.js:30:36)
at http://38.47.108.163/main.dart.js:106270:24
at a. [as aQc] (http://38.47.108.163/main.dart.js:30:36)
at Object.aVD (http://38.47.108.163/main.dart.js:10949:6)
at http://38.47.108.163/main.dart.js:106298:23
at a. [as aPV] (http://38.47.108.163/main.dart.js:27:35)

my code is very simple.
image


**Details to reproduce the issue**
Provide all the details to reproduce the issue.

**Error Log**

main.dart.js:5168 Uncaught Unsupported operation: Platform._operatingSystem
at Object.c (http://38.47.108.163/main.dart.js:5168:19)
at Object.b00 (http://38.47.108.163/main.dart.js:9314:15)
at Object.b01 (http://38.47.108.163/main.dart.js:9346:16)
at http://38.47.108.163/main.dart.js:106263:22
at a. [as yG] (http://38.47.108.163/main.dart.js:30:36)
at http://38.47.108.163/main.dart.js:106270:24
at a. [as aQc] (http://38.47.108.163/main.dart.js:30:36)
at Object.aVD (http://38.47.108.163/main.dart.js:10949:6)
at http://38.47.108.163/main.dart.js:106298:23
at a. [as aPV] (http://38.47.108.163/main.dart.js:27:35)


**Flutter Version details**

Flutter 3.19.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 300451adae (12 天前) • 2024-03-27 21:54:07 -0500
Engine • revision e76c956498
Tools • Dart 3.3.3 • DevTools 2.31.1

used:
file_picker: ^8.0.0+1

@mokanus mokanus added the new issue An issue that hasn't yet been seen from the maintainer label Apr 9, 2024
@mokanus mokanus changed the title The local operation is perfect, and when I use Flutter run -- release, it is also possible. However, when deploying and accessing Flutter build web, errors may occur Web:Uncaught Unsupported operation: Platform._operatingSystem Apr 9, 2024
@mokanus
Copy link
Author

mokanus commented Apr 9, 2024

I fixed by clean cache.

@mokanus mokanus closed this as completed Apr 9, 2024
@navaronbracke navaronbracke self-assigned this Apr 18, 2024
@navaronbracke navaronbracke added feature-candidate This issue might result in a feature to be implemented web Issue applies to Web platform and removed new issue An issue that hasn't yet been seen from the maintainer labels Apr 18, 2024
@navaronbracke navaronbracke reopened this Apr 18, 2024
@omensight
Copy link

Is there a specific reason for this to happen? I can pick files without any problem in debug mode but when I build the project for flutter web it gives me this error.

@omensight
Copy link

I see that when I specify the type it stops working in production:
FilePickerResult? result = await FilePicker.platform.pickFiles( dialogTitle: LocaleKeys.pickBranchLogo.tr(), type: FileType.image, );
It works well without specifying the type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-candidate This issue might result in a feature to be implemented web Issue applies to Web platform
Projects
None yet
Development

No branches or pull requests

3 participants