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

TypeError: Cannot read properties of undefined (reading 'split') #18836

Closed
kevintab95 opened this issue Sep 4, 2023 · 6 comments · Fixed by #19126
Closed

TypeError: Cannot read properties of undefined (reading 'split') #18836

kevintab95 opened this issue Sep 4, 2023 · 6 comments · Fixed by #19126
Assignees
Labels
good first issue Impact: High Blocks or significantly slows down a core workflow. server errors Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.

Comments

@kevintab95
Copy link
Member

kevintab95 commented Sep 4, 2023

This error occurred recently in production:

TypeError: Cannot read properties of undefined (reading 'split')
    at C.isLocationSetToNonStateEditorTab (router.service.ts:214:60)
    at Je.<anonymous> (exploration-editor-page.component.ts:311:31)
    at Generator.next (<anonymous>)
    at exploration_editor.e5d90c2ddba5e4a20ea3.bundle.js:3987:43001

Where did the error occur?
This error occurred in the exploration editor page.

Frequency of occurrence Add details about how many times the error occurred within a given time period (e.g. the last week, the last 30 days, etc.). This helps issue triagers establish severity.
2 times in 2 days.

Additional context

This errored occurred when the user was viewing the URL /create/XXX?story_url_fragment=YYY&topic_url_fragment=ZZZ&classroom_url_fragment=math&node_id=node_3#/.

General instructions for contributors
In general, the procedure for fixing server errors should be the following:

  • Analyze the code in the file where the error occurred and come up with a hypothesis for the reason.
  • Based on your hypothesis, determine a list of steps that reliably reproduce the issue (or confirm any repro instructions that have been provided). For example, if your hypothesis is that the issue arises due to a delay in a response from the backend server, try to change the code so that the backend server always has a delay, and see if the error then shows up 100% of the time on your local machine.
  • Explain your proposed fix, the logic behind it, and any other findings/context you have on this thread. You can also link to a debugging doc if you prefer.
  • Get your approach validated by an Oppia team member.
  • Make a PR that fixes the issue.
@prafulbbandre prafulbbandre added Impact: High Blocks or significantly slows down a core workflow. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. labels Sep 6, 2023
@seanlip
Copy link
Member

seanlip commented Sep 29, 2023

Instructions for contributors:

  • On your local server, open the exploration editor page.
  • Go to isLocationSetToNonStateEditorTab() in router.service.ts. Notice that the first line has a couple of splits that assume there are at least two elements in the splitted string.
  • In your browser, try entering several URLs and attempt to trigger the error in the let currentPath line in isLocationSetToNonStateEditorTab(). Consider also looking at how the flow works -- what function calls isLocationSetToNonStateEditorTab(), what function calls that function, etc. so that you get some idea of the logical flow through the code and what the aim of that function is.
  • Fix the let currentPath line so that it produces the correct result in the case where the URL is not what is expected, rather than throwing an error.

To claim this issue:

  • Explain what causes the error, and demonstrate using a video, that you can reproduce it locally.
  • Explain your proposed fix.

@Rhythm-08
Copy link

@seanlip I would like to solve this issue

@seanlip
Copy link
Member

seanlip commented Oct 3, 2023

@Rhythm-08 Per the guidance at https://github.com/oppia/oppia/wiki/Contributing-code-to-Oppia#choosing-a-good-first-issue, please provide an explanation of what your PR will do (with names of files you're changing, what you plan to change in each file, etc.). I would recommend answering the questions at the end of the previous comment, too. If it looks good, we can assign you to this issue.

Please also follow the other instructions on that wiki page if you have not yet done so. Thanks!

@akitibala
Copy link
Contributor

akitibala commented Oct 3, 2023

@seanlip

I could understand the function you mentioned but I unable to reproduce it locally .

Only way I could reproduce is
Testing url /create/XXX?story_url_fragment=YYY&topic_url_fragment=ZZZ&classroom_url_fragment=math&node_id=node_3# mentioned in issue by removing the slash at the end on console by using logic in the file .

I think more details for bug reproducing might help?

@seanlip
Copy link
Member

seanlip commented Oct 3, 2023

@akitibala Unfortunately, we don't have more details for bug reproduction, since this came up as a server error. So some experimentation will be needed locally.

@kevintab95
Copy link
Member Author

Occurs 1 time in 2 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Impact: High Blocks or significantly slows down a core workflow. server errors Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants