Select to view content in your preferred language

Initialization issues with Firefox

580
6
Jump to solution
11-26-2024 09:58 PM
AIHobart
Occasional Contributor

My website has been having issues with Firefox. This appears to have started recently, I imagine with a newer version of Firefox. We were using esri for javascript 4.25, but we have just updated to 4.30 and are getting the same issue. On loading the map, we get an intermittent error:

TypeError: ua.parentNode is null

This occurs on the require[] call and specifically in the case below, occurs when the SceneView is requested, but on our website where there are many more maps and layers called, removing SceneView doesn't solve the issue. I have hosted an example of the problem here:

https://tobyodonnell-aiau.github.io/StaticSite/

If you view the console, on Chrome/Edge you will get a 'Map module loaded successfully.' message. On Firefox the 'TypeError: ua.parentNode is null' will present itself most of the time. The exact code hosted is below:

 

 

 

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="https://js.arcgis.com/4.30/init.js" data-dojo-config="async: true"></script>
<script>
    window.onload = function () {
		try {
			require([
				"esri/Basemap",
				"esri/views/SceneView"
			], function (
				Map,
				SceneView) {
				console.log("Map module loaded successfully.");
				// logic here
			});
		}
		catch (e) {
			console.log(e);
		}
    };
</script>

</head>
<body></body>
</html>

 

 

This issue happens regularly for Firefox, but not for other browsers. If you put the above code into codepen or another website to test the code, we don't see the issue, but it is easily repeatable with the link above.

Does anyone have any suggestions on how to mitigate this issue, or is this just a bug to raise?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
AIHobart
Occasional Contributor

I think I have figured out the condition where it occurs. Three developers have managed to reproduce the issue with the link above, but a new install of firefox does not reproduce the issue. Re-installing firefox has fixed the issue on my machine. It seems that having a fresh install of firefox is somehow different to having an older version that has been updated to the latest.

Whatever the case, it seems that the issue does not occur on a fresh install of firefox.

View solution in original post

6 Replies
RalucaNicola1
Esri Contributor

What version of Firefox are you using? I consistently get the message that the map module loaded successfully. I am using Firefox 133.0 (seems like it was released yesterday) on Windows.

0 Kudos
AIHobart
Occasional Contributor

I'm using Firefox 133.0, but it wasn't working before the update either (version 132)

0 Kudos
RalucaNicola1
Esri Contributor

it's interesting, I asked a colleague to check on mac as well and we can't reproduce the error.

0 Kudos
AIHobart
Occasional Contributor

I think I have figured out the condition where it occurs. Three developers have managed to reproduce the issue with the link above, but a new install of firefox does not reproduce the issue. Re-installing firefox has fixed the issue on my machine. It seems that having a fresh install of firefox is somehow different to having an older version that has been updated to the latest.

Whatever the case, it seems that the issue does not occur on a fresh install of firefox.

IanHarshbarger
New Contributor

I am also experiencing this issue. The issue also happens on Portal with this error.

Uncaught (in promise) TypeError: U.parentNode is null
Dojo 8
B https://servername/portal/apps/mapviewer/js/app/main.js:68
B https://servername/portal/apps/mapviewer/js/app/main.js:68
default https://servername/portal/apps/mapviewer/js/app/main.js:70
g https://servername/portal/apps/mapviewer/js/app/main.js:22
f https://servername/portal/apps/mapviewer/js/app/main.js:21
w https://servername/portal/apps/mapviewer/js/app/main.js:21
promise callback*y https://servername/portal/apps/mapviewer/js/app/main.js:21
w https://servername/portal/apps/mapviewer/js/app/main.js:21
promise callback*y https://servername/portal/apps/mapviewer/js/app/main.js:21
w https://servername/portal/apps/mapviewer/js/app/main.js:21
promise callback*y https://servername/portal/apps/mapviewer/js/app/main.js:21
C https://servername/portal/apps/mapviewer/js/app/main.js:21
C https://servername/portal/apps/mapviewer/js/app/main.js:21
default https://servername/portal/apps/mapviewer/js/app/main.js:68
<anonymous> https://servername/portal/apps/mapviewer/index.html?layers=956ef274d271464981e6ab4816cf338f:166
Dojo 15
<anonymous> https://servername/portal/apps/mapviewer/index.html?layers=956ef274d271464981e6ab4816cf338f:165



I understand reinstalling Firefox will solve the issue, but that shouldn't be the only solution.

0 Kudos
ECFiberSecretary
New Contributor

I am experiencing this as well on the test site above and elsewhere using Firefox 135.0.1.

In my case the issue is related to script injection on Firefox with certain Add-ons installed. (In my case, LastPass.) I'm assuming that a fresh installation of Firefox doesn't have these extensions activated which is probably why the problem doesn't occur.

For me the issue only occurs on a refresh or direct load of the URL (paste URL in address bar), not when following a link. There must be some timing differences in DOM/script loading there.

The specific cause of the problem is due to the script injection function looking through script tags via getElementsByTagName('script') and then assuming that the element has a parentNode that is not null. The extension script is injected into the DOM in a way where this is not true and thus execution fails.

I hope this helps and look forward to it being addressed. Thanks!

0 Kudos