Skip to content
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

Label Studio Editor not destroying cleanly #6050

Open
kartikwatwani opened this issue Jul 1, 2024 · 0 comments
Open

Label Studio Editor not destroying cleanly #6050

kartikwatwani opened this issue Jul 1, 2024 · 0 comments

Comments

@kartikwatwani
Copy link

Describe the bug
LabelStudio.destroyAll or instance.destroy function of Label studio frontend editor is not destroying properly which is causing problems when trying to render app again in angular app.

To Reproduce
Steps to reproduce the behavior:

  1. In an angular app load the script dynamically when the component is to be used.
  2. After window.LabelStudio is available, create a new instance of label studio binded to div with any id and save it in component property say labelStudioInstance. The editor will show up.
  3. Now in ngOnDestroy call window.LabelStudio.destroyAll or this.labelStudioInstance.destroy()
  4. Now go to some other component so ngOnDestroy is called and come back to the same component that shows label studio editor.

Now the console will show below errors and not render the editor.

zone.js:1155 Uncaught 
Error: MobX Provider: The set of provided stores has changed. See: https://github.com/mobxjs/mobx-react#the-set-of-provided-stores-has-changed-error.
    at Provider (main.js:113378:13)
    at renderWithHooks (main.js:196256:18)
    at updateFunctionComponent (main.js:198627:20)
    at beginWork (main.js:200334:16)
    at HTMLUnknownElement.callCallback (main.js:185216:14)
    at _ZoneDelegate.invokeTask (zone.js:398:33)
    at ZoneImpl.runTask (zone.js:158:47)
    at ZoneTask.invokeTask [as invoke] (zone.js:479:34)
    at invokeTask (zone.js:1105:18)
    at globalCallback (zone.js:1136:29)
The above error occurred in the <MobXProvider> component:

    at Provider (http://localhost:4200/assets/main.js:113366:24)
    at div
    at http://localhost:4200/assets/main.js:303159:5
    at App (http://localhost:4200/assets/main.js:259151:5)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

Expected behavior
After coming back to the component, the editor should render and the MobxProvider error should not come up.

Environment (please complete the following information):

  • OS: macOS
  • Label Studio Version 1.12.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant