[GH-ISSUE #1679] Cannot read properties of null #921

Closed
opened 2026-02-26 02:34:39 +03:00 by kerem · 0 comments
Owner

Originally created by @NikolayTolkovanov-front on GitHub (May 13, 2023).
Original GitHub issue: https://github.com/koel/koel/issues/1679

Describe the bug
When reloading the window, sometimes an error may appear: "Cannot read properties of null (reading 'name')"

To reproduce
Steps to reproduce the behavior:

  1. Go to 'http://localhost:8000'.
  2. Click on button 'reload' until the error appears.

Environment

  • Koel version [6.11.2]
  • OS: [Windows 10]
  • Browser [Chrome, version 113.0.5672.92]
  • PHP version [8.1.5]
  • Node version [18.12.0]

Solve
This error most likely appears due to the fact that during initialization in "@/App.vue" await commonStore.init() an asynchronous request for data is made, the result comes after other components use the properties of the object from "userStore.state".

I replaced in "ProfileAvatar.vue" <img :alt="Avatar of ${currentUser.name}" :src="currentUser.avatar"> with <img :alt="Avatar of ${currentUser?.name}" :src="currentUser?.avatar">

Originally created by @NikolayTolkovanov-front on GitHub (May 13, 2023). Original GitHub issue: https://github.com/koel/koel/issues/1679 **Describe the bug** When reloading the window, sometimes an error may appear: "Cannot read properties of null (reading 'name')" **To reproduce** Steps to reproduce the behavior: 1. Go to 'http://localhost:8000'. 2. Click on button 'reload' until the error appears. **Environment** - Koel version [6.11.2] - OS: [Windows 10] - Browser [Chrome, version 113.0.5672.92] - PHP version [8.1.5] - Node version [18.12.0] **Solve** This error most likely appears due to the fact that during initialization in "@/App.vue" `await commonStore.init()` an asynchronous request for data is made, the result comes after other components use the properties of the object from "userStore.state". I replaced in "ProfileAvatar.vue" `<img :alt="Avatar of ${currentUser.name}" :src="currentUser.avatar">` with `<img :alt="Avatar of ${currentUser?.name}" :src="currentUser?.avatar">`
kerem closed this issue 2026-02-26 02:34:39 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#921
No description provided.