-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
useMonaco hook causing 'operation is manually cancelled' error #575
Comments
I would like to know:
|
I tried turning it on and off, the issue still persists. The app is functioning fine in development.Regards,RohitOn Jan 22, 2024, at 10:39 AM, Suren Atoyan ***@***.***> wrote:
I would like to know:
do you use React Strict mode?
Do your app and monaco function normally? Does this affect your app?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I can confirm the issue. On my setup I use StrictMode. It happens with a child component (that uses useMonaco()) and that may have something to do with loading the files or something like this , because the workaround that worked for me was to conditionally render the child component (which uses useMonaco() internally) after onMount has return an instance of monaco. The thing is that if you already have loaded the library one time, then this problem does not occur.. but on my setup if I refresh with CTRL+F5 then it happens. I noticed it right after I finished refactoring of some of my work... i noticed the problem after I refreshed with CTRL+F5. Hope this helped. |
I encountered the same A hack to suppress the log is to add a global error handler: // index.tsx / App.tsx
// ...
window.addEventListener("unhandledrejection", (event) => {
if (event.reason && event.reason.name === "Canceled") {
event.preventDefault();
// custom logging
}
}); This doesn't solve the root issue but helps keep the console clean. |
Describe the bug
The useMonaco hook in Vite project is causing uncaught promise error.
To Reproduce
Screenshots
If applicable, add screenshots to help to explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: