developit / greenlet

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

Edge issue. SCRIPT5022: SecurityError #34

Closed sergeyschegolev closed 5 years ago

sergeyschegolev commented 6 years ago

Hi guys. Have tried to use greenlet for my project but got security error in the Microsoft Edge(40.15063.674.0). security_error Any help would be very appreciated!

Thanks in advance

optimusway commented 6 years ago

Seems the same issue in the Safari, ver 11.1.1 Here is the error i receive SecurityError: The operation is insecure.

i tried with the sample from README. Here it is https://repl.it/@optimusway/greenlet

developit commented 6 years ago

I believe this is caused by CSP.

Is it possible the error goes away using greenlet@0.1.2 instead of the current version?

jamsesso commented 5 years ago

Just wanted to add to this thread, but I ended up doing something like this:

import greenlet from 'greenlet';

export function safeGreenlet(f) {
  try {
    return greenlet(f);
  } catch (e) {
    console.warn('Error creating a worker, degrading experience:', e);
    return f;
  }
}

This might not be an appropriate solution for others.

spkellydev commented 5 years ago

I've issues a pull request for this issue, but in the meantime if anyone needs a quick fix https://www.npmjs.com/package/greenlet-with-edge