Opened 5 weeks ago

Closed 5 weeks ago

Last modified 3 weeks ago

#2101 closed defect (fixed)

JavaScript error on login page

Reported by: nicklas Owned by: everyone
Priority: minor Milestone: BASE 3.11.2
Component: web Version:
Keywords: Cc:

Description

The error log shows the following on the login page:

TypeError: element is null
Data</data.get@http://127.0.0.1:9080/base-2097/include/scripts/main-2.js?v=3.12.0:866:7
TextOverflow</overflow.getOverflowMethod@http://127.0.0.1:9080/base-2097/include/scripts/main-2.js?v=3.12.0:4698:10
TextOverflow</internal.initCheck@http://127.0.0.1:9080/base-2097/include/scripts/main-2.js?v=3.12.0:4780:7
Doc</internal.invokeFinalizers@http://127.0.0.1:9080/base-2097/include/scripts/main-2.js?v=3.12.0:630:5
Doc</internal.initDocument@http://127.0.0.1:9080/base-2097/include/scripts/main-2.js?v=3.12.0:543:3

and

TypeError: element is null main-2.js:866:7
Data</data.get http://127.0.0.1:9080/base-2097/include/scripts/main-2.js:866:7
App</internal.initApp http://127.0.0.1:9080/base-2097/include/scripts/main-2.js:245:10

Doesn't seem to affect functionality.

Change History (3)

comment:1 Changed 5 weeks ago by nicklas

Hmmm... it seems like the source of the error is the footnote frame. For some reason a DOMContentLoaded event is fired but the document.body element is null.

The problem seems also to be related to the AdBlock plugin. If the plug-in is disabled the errors go away.

Additional investigations indicate that the problem is also related to the location.reload() call from the login page. The reload is there so that the footnote page is updated if a user logs out (since it may contain personal data). Skipping the reload or delaying it for a second also seems to get rid of the problem. Could it be that the call to location.reload() triggers a premature DOMContentLoaded event before the DOM is actually loaded? It could be that AdBlock is causing the DOM to take longer to load?

So, I think we should add a short delay before reloading the footnote page and that we should check the document.body before trying to use it.

comment:2 Changed 5 weeks ago by nicklas

  • Resolution set to fixed
  • Status changed from new to closed

(In [7421]) Fixes #2101: JavaScript? error on login page

comment:3 Changed 3 weeks ago by nicklas

Not part of this ticket!! (In [7423]) Fixes #2102: Content security policy violations should not be reported to the server

Last edited 3 weeks ago by nicklas (previous) (diff)
Note: See TracTickets for help on using tickets.