You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start React: Langium Statemachine Language Client & Language Server (Worker) example (only reproducible in local dev mode)
Check strict mode
Start the editor
Check the error in the console (when using webpack error overlay, it will be annoying with popup)
When running in strict mode react will run useEffect twice but won't wait for async code to complete before running the cleanup, so the execution will basically be initializing 1 -> destroying 1 -> initializing 2 -> destroyed 1 -> initialized 1 -> starting 1 -> started 1
the error is thrown inside initializing for second time.
Because both effect and cleanup are asynchronous, one possible solution would be to implement a basic task queue to ensure that nothing runs in parallel.
The text was updated successfully, but these errors were encountered:
When running react-wrapper it will run into race condition during initialization and cleanup and throw an error
Steps to reproduce:
React: Langium Statemachine Language Client & Language Server (Worker)
example (only reproducible in local dev mode)When running in strict mode react will run useEffect twice but won't wait for async code to complete before running the cleanup, so the execution will basically be
initializing 1
->destroying 1
->initializing 2
->destroyed 1
->initialized 1
->starting 1
->started 1
the error is thrown inside initializing for second time.
Because both effect and cleanup are asynchronous, one possible solution would be to implement a basic task queue to ensure that nothing runs in parallel.
The text was updated successfully, but these errors were encountered: