-
Notifications
You must be signed in to change notification settings - Fork 515
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
[BUG] 'ReferenceError: setImmediate is not defined' on the browser #249
Comments
This appears to also be breaking my build. |
Adding Yuzu's polyfill fixed the issue for me: https://github.com/YuzuJS/setImmediate/blob/master/setImmediate.js On top of index.ts/js or at the top of your file(s) that use dataloader, just add: import "setimmediate"; |
Since |
Expected Behavior
DataLoader should gracefully fall back to
setTimeout
ifsetImmediate
is not supported on the browser.Current Behavior
It crashes with an error
ReferenceError: setImmediate is not defined
.Possible Solution
dataloader/src/index.js
Line 242 in 249b2b9
This code also fixes a problem of calling
setTimeout
without a delay number when it falls back.Sorry, I didn't create a PR as I am not familiar with the Flow typing that this project is based on.
The text was updated successfully, but these errors were encountered: