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

Flutter Web - Error: Unsupported operation: _Namespace #142

Open
JojoGogo9 opened this issue May 26, 2021 · 1 comment
Open

Flutter Web - Error: Unsupported operation: _Namespace #142

JojoGogo9 opened this issue May 26, 2021 · 1 comment

Comments

@JojoGogo9
Copy link

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 ()
at runBody (async_patch.dart:84)
at Object._async [as async] (async_patch.dart:123)
at puppeteer.Puppeteer.
.launch (puppeteer.dart:95)
at getSiteMap (PuppeteerMethods.dart:9)
at getSiteMap.next ()
at runBody (async_patch.dart:84)
at Object._async [as async] (async_patch.dart:123)
at Object.getSiteMap (PuppeteerMethods.dart:6)
at main$ (main.dart:83)
at main$.next ()
at async_patch.dart:45
at _RootZone.runUnary (zone.dart:1613)
at _FutureListener.thenAwait.handleValue (future_impl.dart:155)
at handleValueCallback (future_impl.dart:707)
at Function._propagateToListeners (future_impl.dart:736)
at _Future.new.[_complete] (future_impl.dart:533)
at Object._cancelAndValue (stream_pipe.dart:61)
at stream.dart:1219
at _RootZone.runUnaryGuarded (zone.dart:1546)
at _BroadcastSubscription.new.[_sendData] (stream_impl.dart:341)
at _BroadcastSubscription.new.[_add] (stream_impl.dart:271)
at _SyncBroadcastStreamController.new.[_sendData] (broadcast_stream_controller.dart:378)
at _SyncBroadcastStreamController.new.add (broadcast_stream_controller.dart:244)
at auth.dart:307
at Object._checkAndCall (operations.dart:324)
at Object.dcall (operations.dart:329)
at ret (js_patch.dart:411)
at auth.js:1462

@xvrh
Copy link
Owner

xvrh commented Jun 4, 2021

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).

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

2 participants