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

Scope selector bug #93

Open
hunterhector opened this issue Jul 23, 2020 · 0 comments
Open

Scope selector bug #93

hunterhector opened this issue Jul 23, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@hunterhector
Copy link
Member

Describe the bug
Sometimes we can get the following error when using the scope selector.

TypeError: Cannot read property 'span' of undefined
TextArea
src/nlpviewer/components/TextArea.tsx:79
76 | );
77 | const currScopeAnnotation = scopeAnnotations[selectedScopeIndex];
78 |

79 | text = text.substring(
| ^ 80 | currScopeAnnotation.span.begin,
81 | currScopeAnnotation.span.end
82 | );

This is likely caused by trying to use a scope from an non-existing span. For example, if there is no Token, then using scope selector would cause this error.

To Reproduce
Steps to reproduce the behavior:

  1. Prepare data: Add a datapack without entries.
  2. Click which button: select one of the scope, for example, "Token" or "Sentence".
  3. See error: You should see the TypeError above.

Expected behavior
Either report that this cannot be used as Scope, or do not show this in the Scope selector from the start.

Screenshots
image

Here is the scope selector

Environment (please complete the following information):

  • OS: [e.g. Mac OS and Chrome]
  • Version: Chrome 84.0
  • Node Versions: v12.16.1

Additional context
Add any other context about the problem here.

@hunterhector hunterhector added the bug Something isn't working label Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant