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

Unsupported operation: Platform._environment when running on web #304

Open
kantino789 opened this issue Apr 24, 2024 · 0 comments
Open

Unsupported operation: Platform._environment when running on web #304

kantino789 opened this issue Apr 24, 2024 · 0 comments

Comments

@kantino789
Copy link

I am trying to use this library, and I start with the line var browser = await puppeteer.launch();. It works well on Windows, but there is a problem when I run my app as a web app. I get the following error: Error: Unsupported operation: Platform._environment.
And this StackTrace:

dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 279:5                   _environment
dart-sdk/lib/io/platform_impl.dart 83:17                                          get environment
dart-sdk/lib/io/platform.dart 177:59                                              get environment
packages/puppeteer/src/puppeteer.dart 299:71                                      defaultArgs
packages/puppeteer/src/puppeteer.dart 135:28                                      launch
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody

It comes from line 299 in file Puppeteer.dart: noSandboxFlag ??= Platform.environment['CHROME_FORCE_NO_SANDBOX'] == 'true';

My config is the following:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Version 10.0.19045.4291], locale en-GB)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.1)
[√] Android Studio (version 2021.2)
[√] IntelliJ IDEA Community Edition (version 2022.1)
[√] VS Code (version 1.88.1)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

Do I do something wrong or is it something that has to be fixed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant