moodtracker icon indicating copy to clipboard operation
moodtracker copied to clipboard

TypeError: Cannot read properties of undefined (reading 'register')

Open Poachedegg opened this issue 1 year ago • 3 comments

I'm sorry my skills are holding me back When I set up the environment, the deployment was successful but the open page appeared TypeError: Cannot read properties of undefined (reading 'register') image image

By the way, if you have docker, I really want a docker image

Poachedegg avatar Apr 02 '24 06:04 Poachedegg

There is a problem registering the service worker. This could happen due to your browser not supporting the API, disabling it via settings or if you are using incognito mode. If you paste 'serviceWorker' in navigator in your console I expect you will get false. You need to change your setup so that evaluates to true.

I have considered changing the code so it doesn't throw a hard error in this case, but it'd take some thought and effort because the service worker is used for some crucial functionality like offline mode and notifications.

Dockerization wouldn't help in this case because it is (probably) an issue with your browser.

Hope that helps, let me know how you get on

benji6 avatar Apr 02 '24 08:04 benji6

Did you make code changes? To help debug it would be helpful to check:

  • whether evaluating 'serviceWorker' in navigator in the browser console is true or false
  • whether evaluating window.isSecureContext in the browser console is true or false

Both need to be true for the application to run

benji6 avatar Apr 03 '24 13:04 benji6