flecs icon indicating copy to clipboard operation
flecs copied to clipboard

[Bug]: lyrics romanization is "undefined"

Open Rizkiacry opened this issue 9 months ago • 5 comments

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

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

  1. install plugin
  2. go to japanese song
  3. lyrics

Expected Behavior

should display romanization

Actual Behavior

shows "undefined"

Image

Enabled plugins

  1. Ad Blocker
  2. API Server [Beta]
  3. Navigation
  4. Synced Lyrics

Additional Information

No response

Rizkiacry avatar Mar 30 '25 06:03 Rizkiacry

I could repro, but that was only for 2 seconds, it then replaced the undefined with the actual romanization.

ArjixWasTaken avatar Mar 30 '25 15:03 ArjixWasTaken

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?

yashhhYB avatar Apr 02 '25 05:04 yashhhYB

Hello ChatGPT @yashhhYB

ArjixWasTaken avatar Apr 02 '25 07:04 ArjixWasTaken

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

scarrrr316 avatar Apr 09 '25 18:04 scarrrr316

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.

JellyBrick avatar Apr 09 '25 22:04 JellyBrick