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

Error LateInitializate FilePicker.platform.pickFiles() web production #1602

Open
3 tasks
Felixmda opened this issue Oct 1, 2024 · 17 comments
Open
3 tasks
Labels
new issue An issue that hasn't yet been seen from the maintainer stale

Comments

@Felixmda
Copy link

Felixmda commented Oct 1, 2024

Before creating an issue, make sure that you are on the latest file_picker version and that there aren't already any similar opened inssues. Also, check if it isn't described on the Wiki, specially on Troubleshooting page.

Also, sometimes a simple flutter clean and flutter build again with latest file_picker version, may end up by fixing cached issues, so I encourage you to first do so.

Describe the bug
A clear and concise description of what the bug is. If the issue happens to be on Android, please make sure that it also happens with a different device/simulator and/or version.

Platform

  • Android
  • iOS
  • [x ] Web
  • Desktop

Platform OS version
What version did it happen?
8.1.2

How are you picking?

Please, post the snippet here
``` FilePickerResult? result = await FilePicker.platform.pickFiles();


Error LateInitializate class in web production, in local dev no exists error. 

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

**Error Log**
Please, post the _full_ console log of your issue, if applicable.

**Screenshots and/or video**
If applicable, add screenshots or video to help explain your problem.

**Flutter Version details**
Please, post the output of your `flutter doctor -v`, preferably, while running the issued device/simulator.

**Additional context**
Add any other context about the problem here.
@Felixmda Felixmda added the new issue An issue that hasn't yet been seen from the maintainer label Oct 1, 2024
@pahtz
Copy link

pahtz commented Oct 2, 2024

This problem goes away if I turn off optimizations i.e., flutter build web --dart-define=Dart2jsOptimization=00

        await FilePicker.platform.pickFiles(withData: true);

Error on Chrome Windows and Safari iOS: LateInitializationError: Field '_instance' has not been initialized.

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.22.2, on IDX GNU/Linux 6.1.100+, locale en_US.UTF-8)
• Flutter version 3.22.2 on channel stable at /home/user/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (4 months ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3

Using idx.google.com to develop then deploy to Firebase hosting.

@0x456d7265
Copy link

I have the same problem. Here is the log in Chrome Dev Console

main.dart.js:5896 Uncaught Error: LateInitializationError: Field '_instance' has not been initialized.
    at Object.d (main.dart.js:5896:19)
    at bag.bS (main.dart.js:64563:21)
    at Object.c1y (main.dart.js:12962:20)
    at Object.c1z (main.dart.js:12963:16)
    at main.dart.js:151013:14
    at byt.a (main.dart.js:7285:63)
    at byt.$2 (main.dart.js:64805:14)
    at bxh.$1 (main.dart.js:64799:21)
    at arj.G_ (main.dart.js:66001:33)
    at bgh.$0 (main.dart.js:65273:11)

Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Oct 13, 2024
@b14cknc0d3
Copy link

Any update?

@github-actions github-actions bot removed the stale label Oct 19, 2024
Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Oct 27, 2024
@chebyshevvv
Copy link

async method is needed.

@github-actions github-actions bot removed the stale label Oct 29, 2024
@ArbazSparkoSol
Copy link

Experiencing the same issue here. When I was running it locally, It was running fine. But when I deployed my project to production on firebase hosting. It started giving the above error.

@b14cknc0d3
Copy link

Flutter clean and push again solved!

@abhishekhugetech
Copy link

was facing something similar and found this out

@xSuperMu
Copy link

xSuperMu commented Nov 5, 2024

I'm facing the same problem. it's not working on production.

file_picker: ^8.1.3

Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Nov 13, 2024
@Kristijan505
Copy link

Issue is still here on 8.1.4

@xSuperMu
Copy link

I'm Still facing the same problem. it's not working on production.

file_picker: ^8.1.4

@Kristijan505
Copy link

Got it to work on production by setting version strictly to 8.1.0.

file_picker: 8.1.0

@github-actions github-actions bot removed the stale label Nov 16, 2024
Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Nov 24, 2024
@JordiCanton
Copy link

Same problem here. Workaround applied compiling with flutter build web --dart-define=Dart2jsOptimization=00
Without that option we get the same error on production

@github-actions github-actions bot removed the stale label Nov 26, 2024
Copy link

github-actions bot commented Dec 4, 2024

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer stale
Projects
None yet
Development

No branches or pull requests

10 participants