No internet connection
  1. Home
  2. Issues

TypeError: e is null

By @cayhorstmann
    2021-08-04 19:36:12.129Z

    Hi, is there an issue with Talkyard if nobody had a comment? For example, on

    https://horstmann.com/unblog/2021-08-02/index.html

    I get

    TypeError: e is null

    but on

    https://horstmann.com/unblog/2020-05-20/index.html

    with what seems to be the same invocation of Talkyard, I see a comment.

    • 9 replies
    1. Hi Cay, what browser? (and version?)
      I visited those pages in Chrome and Firefox and had a look in Dev Tools, didn't see the error — there was something else instead, on that 2021-08-02 page:

      Exception { name: "NS_ERROR_FAILURE", message: "", result: 2147500037, filename: "https://c1.ty-cdn.net/-/assets/v0.2021.21/slim-bundle.min.js", lineNumber: 10, columnNumber: 0, data: null, stack: "e.store_getApproxPageWidth@https://c1.ty-cdn.net/-/assets/v0.2021.21/slim-bundle.min.js:10:261017\nisPageWide@https://c1.ty-cdn.net/-/assets/v0.2021.21/slim-bundle.min.js:10:520702\ncheckSizeChangeLayout@https://c1.ty-cdn.net/-/assets/v0.2021.21/slim-bundle.min.js:10:520570\n" }
      
      1. C@cayhorstmann
          2021-08-05 12:56:18.536Z

          Hi, the page looks ok with Chrome but not with FF on Linux. Here is from the logs:

          Failed to register/update a ServiceWorker for scope ‘https://comments-for-horstmann-com.talkyard.net/’: Storage access is restricted in this context due to user settings or private browsing mode.
          rror registering service worker [TyESWREGKO] DOMException: The operation is insecure. slim-bundle.min.js:10:5556
          registerServiceWorkerWaitForSameVersion https://c1.ty-cdn.net/-/assets/v0.2021.21/slim-bundle.min.js:10
          Error handling GET response [TyEGETCLBK] from: /-/load-my-page-data?pageId=0 TypeError: e is null

          I don't think I have any user settings.

          1. I think this is because of using private browsing / incognito mode. Then, the service worker won't work, but Talkyard tries to start it, and then that problem happens.

            To me, the iframe and Talkyard comments seem to work (I didn't try actually posting a comment though, just opened the editor). It's just an error message in the Dev Tools console. — But I think I'm using a different FF version than you.

            Does the comments iframe instead break, in your case? (Or does it work okay, you can post a comment, it's just an error log message?)

            Which FF version do you use?

            With Fixefox 78.12.0esr I get this: (warning log level, on this page: https://horstmann.com/unblog/2021-08-02/index.html )

            Cannot use any service worker — they require HTTPS or http://localhost, not incognito mode. [TyMSWMISSNG] slim-bundle.min.js:10:4460

            And with Chrome 92.0.4515.131 I get this: (error log level)

            slim-bundle.min.js:10 Error registering service worker [TyESWREGKO] DOMException: Failed to register a ServiceWorker for scope ('https://comments-for-horstmann-com.talkyard.net/') with script ('https://comments-for-horstmann-com.talkyard.net/talkyard-service-worker.min.js'): The user denied permission to use Service Worker.

            Seems it's not that easy to know if such an error happens because of private browsing mode, or if it's because of some bug in Talkyard, without looking at the text in the error message generated by the browser. Which would be a bit fragile.

            (B.t.w. now there's a new version of Talkyard, so your stack trace might look slightly different.)

            1. C@cayhorstmann
                2021-08-06 09:45:29.472Z

                I am not using private browsing or incognito mode. But in preparation of this becoming the standard, I have "Enhanced Tracking Protection" set to Strict. If I set it back to Standard, the plugin loads.

                1. Then I think Talkyard can assume that if Ty runs in an iframe, then, if the Service Worker doesn't work, it's because of some flavor of tracking protection (be it Enhanced (FF) or Intelligent Tracking Protection (iOS)), and just log an info message instead of the error.

                  Didn't know (or had forgot) about those upcoming changes in FF, good to have read about it now.

                  1. The upcoming version now knows that the service worker might be unusable, if in an <iframe>, and then won't try to use it. — If there were any other problems in addition to the error log messages, I hope this'll fix those as well.

          2. In reply tocayhorstmann:

            Hi Cay, I think (or hope) this has been fixed now — would you like to try?

            If I visit the previously misbehaving / logged-an-error page, https://horstmann.com/unblog/2021-08-02/index.html,

            then, instead of an error, Talkyard now logs this message: Cannot use any service worker — they require HTTPS or http://localhost, not incognito mode. [TyMSWMISSNG]
            and thereafter doesn't try to use the Service Worker.

            (Maybe the log level should be Info, not Warn, though, for that new log message.)

            1. C@cayhorstmann
                2021-08-27 10:10:20.227Z

                Yes, it is working fine now with Firefox. Lots of chatter in the console, but just debug messages. No errors.

                1. Yes definitely chatty! There're some messages that should be Trace or Debug log level instead, or not logged at all unless &debug=... in the URL or sth like that.

                  Thanks for trying & verifying, I'm closing this topic then (& hopefully will remember to change the log levels)

              • Progress
                with handling this problem
              • @KajMagnus marked this topic as Started 2021-08-22 08:56:48.509Z.
              • @KajMagnus marked this topic as Done 2021-08-27 13:26:09.887Z.