YouTube-Music: App fails to load https://music.youtube.com with error

I’ve started getting a blank screen when opening the app. I built from source, enabled the inspector, and I’m seeing this error:

[Error] FetchEvent.respondWith received an error: TypeError: undefined is not an object (evaluating 'a.preloadResponse.then')
[Error] Cannot load https://music.youtube.com/.
[Error] Failed to load resource: FetchEvent.respondWith received an error: TypeError: undefined is not an object (evaluating 'a.preloadResponse.then') (music.youtube.com, line 0)

I can get it to go to any other page, including Youtube itself. But Youtube Music fails every time now.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

1.3.3 seems to have fixed it for me. Thanks @jscheel @TimOliver 🙇!

I’m thinking we might have to add code to force-unregister the service workers that are already installed for people. I’ll make an update for that asap.

On Tue, May 3, 2022 at 9:19 AM mark-pictor-csec @.***> wrote:

I was able to update to 1.3.2 from within the app, but I still can’t play music.

— Reply to this email directly, view it on GitHub https://github.com/steve228uk/YouTube-Music/issues/163#issuecomment-1116155787, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABTUFWV6U4K4HQHNXSLDTTVIEYWTANCNFSM5UWKNTCQ . You are receiving this because you were mentioned.Message ID: @.***>

Ok, I have a possible solution. It’s a hammer, but it seems to be working: I’ve set up a ContentRuleList in the WkWebView to prevent sw.js from loading. This prevents the service worker from registering, which in turn prevents the prefetching/caching of the code that seems to be broken for some reason. I need to clean up all my other test code to make sure this works consistently.

Should Close this no, as I don’t see this anymore as well

Thanks @jscheel! I’ve merged your PR and released a new update. It should download the next time you open the app.

@mark-pictor-csec Try opening the app and downloading the latest update, and see if the problem persists for you after that. 😃