TypeError: e is null
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.
- KajMagnus @KajMagnus2021-08-05 09:55:40.973Z
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" }
- C@cayhorstmann
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 nullI don't think I have any user settings.
- KajMagnus @KajMagnus2021-08-06 07:17:02.324Z
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.)
- C@cayhorstmann
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.
- KajMagnus @KajMagnus2021-08-09 15:06:27.624Z
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.
- KajMagnus @KajMagnus2021-08-22 08:56:35.509Z
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.
- In reply tocayhorstmann⬆:KajMagnus @KajMagnus2021-08-27 09:03:28.652Z
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.)
- C@cayhorstmann
Yes, it is working fine now with Firefox. Lots of chatter in the console, but just debug messages. No errors.
- KajMagnus @KajMagnus2021-08-27 13:26:03.489Z
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)
- Progresswith handling this problem