-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[v3][Web] setImmediate
is not defined
#4140
Comments
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
Im encountering this as well on 3.0.1 |
there is indeed a reproduction. |
I solved this by:
However I'd prefer not to have this shim necessary |
yeah same |
I can confirm that RN Skia is affected by this issue as well. |
Finally found the same issue. Webpack was swallowing the exception during module initialization -_-. setImmediate is being called when undefined in both a minimal VM environment on node for SSR and in the browser. |
I have reproduced this as well. Not liking the workaround... Anyone have a patch in progress? Seems somewhat related to software-mansion/react-native-gesture-handler#2402 |
Looks like there is a PR here? #4189
|
I opened that stackblitz link but it works alright for me, it looks like I even tried downloading the project and starting it locally, but again, it all works fine |
adding |
ok, I see it now. So the repro repository actually had setImmediate installed as dependency and imported in main project file hence it wasn't crashing. I remove that and now can see that error |
Adding import "setimmediate" in App.tsx root file solve my problem |
## Summary This PR removes uses of setImmediate which is not a standard API across web browsers. Instead, we use queueMicrotask API which is available both in the browser world, in React Native and in Node. Fixes software-mansion#4140 ## Test plan Run example app, test WebExample, test repro app from software-mansion#4140 with `import setImmediate` removed
I had the same issue in React native. I had to put But thanks @costaDZ, you saved me. |
3.3.0 version should resolve this problem. |
Then with 3.3.0 I get this error: |
Description
This bug has appeared over the years many times. The solution has been to use
requestAnimationFrame
instead ofsetImmediate
on Web.The regression came from #3970
See: #2622 #152.
Steps to reproduce
Use Reanimated on Next.js.
Snack or a link to a repository
https://stackblitz.com/edit/nextjs-pxczpl?file=pages%2Findex.js,next.config.js,package.json
Reanimated version
3.0.0
React Native version
0.71
Platforms
Web
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: