[Bug]: lyrics romanization is "undefined"
Preflight Checklist
- [x] I use the latest version of YouTube Music (Application).
- [x] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
- [x] I understand that th-ch/youtube-music has NO affiliation with Google or YouTube
YouTube Music (Application) Version
3.8.0
Checklists
- [ ] I use the portable version of the YouTube Music Application.
- [ ] I can reproduce this issue in the official version of (WEB) YTM.
What operating system are you using?
macOS
Operating System Version
macos sonoma 14.2.1
What CPU architecture are you using?
arm64 (including Apple Silicon)
Last Known Working YouTube Music (Application) version
No response
Reproduction steps
- install plugin
- go to japanese song
- lyrics
Expected Behavior
should display romanization
Actual Behavior
shows "undefined"
Enabled plugins
- Ad Blocker
- API Server [Beta]
- Navigation
- Synced Lyrics
Additional Information
No response
I could repro, but that was only for 2 seconds, it then replaced the undefined with the actual romanization.
Hey @Rizkiacry,
It looks like the romanization briefly shows "undefined" before displaying correctly. This might be due to a delay in fetching the lyrics from the API. Here are a few things you can try:
Check API Response Timing – The lyrics might be loading slower than expected. If possible, try refreshing the lyrics manually and see if that helps.
Disable Other Plugins – Some plugins might be interfering. Try disabling everything except "Synced Lyrics" and see if the issue persists.
Inspect the Network Tab – If you open DevTools (Cmd + Option + I on macOS) and check the Network tab, you might see if the lyrics API is returning undefined initially.
Test on the Web Version – Since you mentioned the issue happens in both the app and web versions, can you check if this also occurs on the official YouTube Music website without the plugin?
Hello ChatGPT @yashhhYB
I guess the reason is that the dict for Japanese Romanization is fetched from jsDelivr instead of locally. I tested and it takes about 1-2sec to initialize the KuromojiAnalyzer https://github.com/th-ch/youtube-music/blob/c375e73781c74268791aa989ca4eee5d2e1ff5b0/src/plugins/synced-lyrics/renderer/utils.tsx#L138-L142
I guess the reason is that the dict for Japanese Romanization is fetched from jsDelivr instead of locally. I tested and it takes about 1-2sec to initialize the KuromojiAnalyzer
youtube-music/src/plugins/synced-lyrics/renderer/utils.tsx
Lines 138 to 142 in c375e73 await _kuroshiro.init( new KuromojiAnalyzer({ dictPath: 'https://cdn.jsdelivr.net/npm/[email protected]/dict/', }), );
After the first run, all files are cached locally.