puppeteer-dart
puppeteer-dart copied to clipboard
Flutter Web - Error: Unsupported operation: _Namespace
I'm trying to use puppeteer for Server Side Rendering, but get this exception - I believe because puppeteer relies on dart.io
Is it possible to move from dart.io to universal_io to support flutter web? (I apologize in advance if this won't fix the issue)
Uncaught (in promise) Error: Unsupported operation: Namespace
at Object.throw [as throw] (errors.dart:236)
at Function.get _namespace [as _namespace] (io_patch.dart:200)
at Function.get systemTemp [as systemTemp] (directory_impl.dart:138)
at Function.get systemTemp [as systemTemp] (directory.dart:203)
at puppeteer.Puppeteer..launch (puppeteer.dart:136)
at launch.next (
Hi,
I think moving to universal_io is a good idea and can solve this problem. You won't be able to use the launch
method in a browser (because it involves launching an OS process) but you will be able to use connect
.
Alternatively, we could reorganise the methods and move launch
to its own puppeteer_io.dart
file (or create puppeteer_web.dart
without it).