wet-boew / wet-boew

Web Experience Toolkit (WET): Open source code library for building innovative websites that are accessible, usable, interoperable, mobile-friendly and multilingual. This collaborative open source project is led by the Government of Canada.

Home Page:https://wet-boew.github.io/wet-boew/index-en.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught TypeError wet-boew.js 10524

IceBane opened this issue · comments

I get the following error in my console in my implementation of the Session Timeout component.

_wet-boew.js:10524 Uncaught TypeError: Cannot read properties of undefined (reading 'textContent')
    at u.open (wet-boew.js:10524:34)
    at z (jquery.magnific-popup.min.js:4:710)
    at u.open (jquery.magnific-popup.min.js:4:4018)
    at u._openClick (jquery.magnific-popup.min.js:4:6989)
    at a.fn.magnificPopup (jquery.magnific-popup.min.js:4:9866)
    at h (wet-boew.js:14099:23)
    at f (wet-boew.js:14009:17)
    at HTMLSpanElement.<anonymous> (wet-boew.js:14348:10)
    at HTMLDocument.dispatch (jquery.min.js:2:42571)
    at v.handle (jquery.min.js:2:40572)_

Here is my implemenation of the component;

$(document).on("wb-ready.wb", function (event) {
    var settings = {
        inactivity: 60000,                          // 1 mins
        reactionTime: 30000,                         //  30 secs
        sessionalive: 60000,                        // 1 mins
        refreshCallbackUrl: "./keepAlive",
        logouturl: "./login",
        method: "GET",
        refreshCallback: checkSessionValidity
    }

    $(".wb-sessto").trigger("reset.wb-sessto", settings);
});

Why am I getting this error?

Do you have an H1 tag in your page?

put <h1 id="wb-cont" property="name">Session Timeout</h1> in your page, see if that helps.

If not, view line # 10524 of your wet-boew.js.

What version of WET?

Do you have an H1 tag in your page?

put <h1 id="wb-cont" property="name">Session Timeout</h1> in your page, see if that helps.

If not, view line # 10524 of your wet-boew.js.

What version of WET?

I do not have an H1 component on the page that hold the session timeout component. Line 10524 of wet-boew.js is a blank line, the numbering must be off.

The wet version indicated at the top of the wet-boew.js file is v4.0.27

Put an H1 tag at on your page <h1>What ever you Want in for Header One</h1> and see if the error goes away.
My testing showed that this should fix your error.

But whether this is required or a bug is another question. Same issue with v4.0.75.

So far so good. Weird that it requires an H1. Thank you so much for your help mercury64