TypeError: Cannot read property 'toLowerCase' of undefined

3945
2
Jump to solution
08-06-2021 02:59 PM
Labels (1)
BillMitchell
New Contributor III

I am attempting to migrate a webapp from ArcGIS Enterprise 10.7.1 up to 10.8.1.

Unfortunately, when I open the query tool, query one of the layers, then try to open the results in the attribute table, there is an error which then breaks the attribute table (can't resize, desired query layer not added, and when toggling the attribute table off it just makes it blank rather than resizing the map canvas to fill its space).

Correspondingly, there is an error in the javascript console (up to date Chrome and Firefox), as seen below both as text and as screenshots.  While the app isn't publicly available, the general idea is that there are a few layers, and a query tool that has the capability to find features in a specified layer within <distance> of features in the query's main layer, in addition to finding the relevant features in the primary layer.

On 10.7.1, the behavior of the query widget allowed the attribute table to be opened/used fully when no secondary layer was specified in the query.  With 10.8.1, even when the layer is specified, (removing one line of output about 'no layer specified'), the error still occurs.

Is there a way to serve it with wab_dv=2.12 again?  Or to upgrade (not just change the version numbers---I tried that) the web app itself to be compatible with the new version in a way that the attribute table works with the query tool?

 

An excerpt of the Chrome output, from a few lines before the error to a few lines into the stack trace, is provided both in text and screenshot form.

widget [widgets/Query/Widget] created.
Widget.js?wab_dv=2.16:12 User doesn't select a layer
main.js?wab_dv=2.16:273 widget [widgets/AttributeTable/Widget] created.
main.js?wab_dv=2.16:207 AttributeTable
init.js:115 TypeError: Cannot read property 'toLowerCase' of undefined
at Object.f.focus (init.js:271)
at Object._applyA11y2TabContainer (Widget.js?wab_dv=2.16:239)
at Object.applyA11y (Widget.js?wab_dv=2.16:234)
at Object.initDiv (Widget.js?wab_dv=2.16:279)
at Object._init (Widget.js?wab_dv=2.16:260)
at Object.<anonymous> (Widget.js?wab_dv=2.16:258)
at init.js:64
at m (init.js:108)
at e.then.b.then (init.js:111)
at Object._openTable (Widget.js?wab_dv=2.16:258) "TypeError: Cannot read property 'toLowerCase' of undefined\n at Object.f.focus (https://portaldev.gisdata.mn.gov/portal/jsapi/jsapi/init.js:271:169)\n at Object._applyA11y2TabContainer (https://portaldev.gisdata.mn.gov/crashmart/widgets/AttributeTable/Widget.js?wab_dv=2.16:239:484)\n

Screenshot of text from debugging console in Chrome showing the error (TypeError: Cannot read property 'toLowerCase' of undefined [init.js:115]); relevant section copied into body text of forum post.Screenshot of text from debugging console in Chrome showing the error (TypeError: Cannot read property 'toLowerCase' of undefined [init.js:115]); relevant section copied into body text of forum post.

The error in Firefox is similar, but a little different (screenshot follows relevant text):

widget [widgets/Query/Widget] created. main.js:273:103
User doesn't select a layer Widget.js:12:410
widget [widgets/AttributeTable/Widget] created. main.js:273:103
AttributeTable main.js:207:342
 

TypeError: c.tagName is undefined

Screenshot of text from debugging console in Firefox showing the error (TypeError: c.tagName is undefined [init.js:115:271]); relevant section copied into body text of forum post.Screenshot of text from debugging console in Firefox showing the error (TypeError: c.tagName is undefined [init.js:115:271]); relevant section copied into body text of forum post.

This seems similar to another (unanswered) question here: https://community.esri.com/t5/arcgis-web-appbuilder-questions/type-error-wab-2-16-attribute-table-wi...

0 Kudos
1 Solution

Accepted Solutions
BillMitchell
New Contributor III

After a long back and forth on a support ticket, we eventually came to the conclusion in October/November 2021 that this is from a bug specific to the Launchpad theme which happens when upgrading from 10.7.1 to 10.8.1.  It is fixed in the 10.9 release.

View solution in original post

0 Kudos
2 Replies
BillMitchell
New Contributor III

I used the download option from the 10.7.1 Portal, put that code directory on the new server, and updated the `config.json` and `env.js` files to use the new versions from 10.8.1 (with updated DNS names, etc.).  This has fixed the problem, which strengthens my suspicion that the issue here is in the javascript libraries bundled with Web AppBuilder apps.

Given that if my app were to break I don't have a great way to fix it once the 10.7.1 machine is decommissioned, I don't really consider this a workable solution.  It is a stopgap workaround, but needs a more solid fix soon.

0 Kudos
BillMitchell
New Contributor III

After a long back and forth on a support ticket, we eventually came to the conclusion in October/November 2021 that this is from a bug specific to the Launchpad theme which happens when upgrading from 10.7.1 to 10.8.1.  It is fixed in the 10.9 release.

0 Kudos