developit / greenlet

🦎 Move an async function into its own thread.
https://npm.im/greenlet
4.67k stars 100 forks source link

Cannot use greenlet in node. TypeError: URL.createObjectURL is not a function #53

Open winston0410 opened 3 years ago

winston0410 commented 3 years ago

I am trying to use greenlet in an isomorphic application, where the code will be run in browser and server. I am struggling to use it in node, where I keep getting TypeError: URL.createObjectURL is not a function.

I have tried the following polyfill but no luck.

global.Worker = require('tiny-worker')
global.Blob = require('cross-blob')
global.URL = require('url-polyfill')

What should I do to run greenlet in node?

gregpalaci commented 3 years ago

was about to ask that too I tried global.Worker = require("webworker");