cmv-widgets icon indicating copy to clipboard operation
cmv-widgets copied to clipboard

Disclaimer box unreliably loading

Open wrightgd opened this issue 10 years ago • 25 comments

I am trying to use the Disclaimer, but I'm finding it to unreliably load. I'd guess it's showing up maybe 30% of the time I load my map application. When it does not load, I see the following code in the console:

Uncaught Error: uniqName_5: parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin.   Must pre-load all supporting widgets before instantiation.

One of the operational layers I'm loading is a large aerial image, and I was thinking the lag experienced loading that layer was causing the Disclaimer not to load. However, even when I do not bring in that aerial layer, the problem still persists.

Thoughts? Thanks!

wrightgd avatar Apr 24 '15 16:04 wrightgd

Please check that you have the most recent version of the widget. There was a similar issue in the initial release that was addressed a month ago: https://github.com/tmcgee/cmv-widgets/commit/cbdc2f890bc6de04da81affbfb8c0cdd147b86aa

If you do have the latest, please check a couple of things:

  1. Have you modified the Disclaimer code in any way that might include additional widgets/modules?
  2. What other widgets do you have in your app? Any custom ones not provided with the cmv app code?

tmcgee avatar Apr 24 '15 16:04 tmcgee

I just re-downloaded and re-added the widget to make sure I had the latest version--indeed I do.

  1. No, I have made no changes at all to the Disclaimer widget. Only modified the settings in viewer.js.
  2. The Disclaimer widget is the only custom one I have deployed. All others ones came off-the-shelf.

Let me confirm with you that I have integrated this correctly with the off-the-shelf CMV. My process was:

  1. Download your cmv-widgets repository as a zip and unzip.
  2. Move the widgets/Disclaimer/ folder and widgets/Disclaimer.js to my application folder under js/gis/dijit
  3. Copy/paste the Disclaimer settings from your readme file into my viewer.js file and change the path from path: 'widgets/Disclaimer' to path: 'gis/dijit/Disclaimer'.

Anything I've missed here?

wrightgd avatar Apr 24 '15 18:04 wrightgd

It sounds like you have everything setup correctly. I have not been able to reproduce this behavior since the fix that was added a month ago.

tmcgee avatar Apr 28 '15 22:04 tmcgee

I have this issue as well, though my disclaimer shows up probably about 80% of the time. The other 20% of the time I get the same error message listed above accompanied by the following:

dojo/parser::parse() error TypeError: Cannot read property 'toString' of undefined
    at http://js.arcgis.com/3.12compact/init.js:608:209
    at String.replace (native)
    at Object.f.substitute (http://js.arcgis.com/3.12compact/init.js:608:70)
    at q.postMixInProperties (http://js.arcgis.com/3.12compact/dijit/layout/ContentPane.js:5:34)
    at z.create (http://js.arcgis.com/3.12compact/dijit/_WidgetBase.js:5:195)
    at n (http://js.arcgis.com/3.12compact/init.js:106:103)
    at q.create (http://js.arcgis.com/3.12compact/dijit/layout/ContentPane.js:4:375)
    at z.postscript (http://js.arcgis.com/3.12compact/dijit/_WidgetBase.js:4:464)
    at new <anonymous> (http://js.arcgis.com/3.12compact/init.js:108:192)
    at q.markupFactory (http://js.arcgis.com/3.12compact/dijit/layout/ContentPane.js:3:478)

I find that the problem occurs most commonly when I do multiple successive page refreshes (about 5 seconds apart) in the same tab (Chrome 43). I haven't tried to reproduce it in any other browser.

mgd722 avatar Jun 04 '15 16:06 mgd722

I'm having the same issue. The behaviour is as reported by mgd722. In addition I also get the following error:

Uncaught TypeError: Cannot read property 'decimalFormat' of undefined

I followed the same installation procedure as the OP

chernandezCenipalmaOrg avatar Sep 09 '15 16:09 chernandezCenipalmaOrg

@mgd722 Are you still experiencing this erratic behavior? The error message suggests to me that there is a timing issue loading the content of the disclaimer not the widget itself.

@chernandezCenipalmaOrg At first thought, I don't think your decimalFormat error would be related to the Disclaimer widget since we're not doing any number formatting in the widget. There was an error like this that had been identified in the MapInfo widget which was fixed a couple of versions ago. Perhaps that is what you are seeing.

tmcgee avatar Sep 10 '15 13:09 tmcgee

@tmcgee I think the decimalFormat error is due to the scalebar widget malfunctioning when the Disclaimer problem happens, as I noticed it is not displaying the coordinates or the scale of the map and it only happens when the disclaimers fails.

chernandezCenipalmaOrg avatar Sep 10 '15 14:09 chernandezCenipalmaOrg

@chernandezCenipalmaOrg thanks for the additional info. Like the MapInfo widget, the ESRI scalebar widget does numeric formatting so failing in a similar way is plausible.

I guess we need to look for a root cause. The disclaimer and the scalebar widgets could be failing due to the same root cause. I am not saying it isn't the disclaimer that is the cause. I just have not seen this myself and there's very little actual code in the widget.

Is this a possibility in your implementation: http://gis.stackexchange.com/questions/86674/arcgis-api-for-javascript-error-in-dojo-parser-parse which points to this thread: https://geonet.esri.com/thread/81475

tmcgee avatar Sep 10 '15 15:09 tmcgee

@tmcgee I'm still having the issue, but it's very sporadic. None of my users have reported it and it really only seems to come up when I'm trying to debug something. Also, even when it fails to load, the rest of the app still works fine.

mgd722 avatar Sep 10 '15 15:09 mgd722

@tmcgee I just switched my content from a div with inline CSS (and a paragraph or two) to <h1>TEST</h1>. I haven't been able to reproduce the error like I used to. I think you're right; this is probably a timing issue when loading disclaimer html.

mgd722 avatar Sep 10 '15 15:09 mgd722

@mgd722 thanks for the feedback. I'm not sure how to address that within the disclaimer widget. Might be an issue with ContentPane used by the disclaimer widget?

tmcgee avatar Sep 10 '15 15:09 tmcgee

If you have a lot of html content and are using the content attribute, you could try to put the html into a separate html file and use the href attribute to lazy load it.

tmcgee avatar Sep 10 '15 15:09 tmcgee

@tmcgee Yeah, I was going to give that a try but then got pulled away for a bit. I'll load my original html that way some time this afternoon and report back.

mgd722 avatar Sep 10 '15 16:09 mgd722

I have the lang="es-ES" in my page. I'm going to test what happens removing it an I'll let you know.

chernandezCenipalmaOrg avatar Sep 10 '15 16:09 chernandezCenipalmaOrg

I just tested lazy loading my html. I was still able to get the error to occur, but it was much less frequent (48 out of 50 refreshes, or 96%, went as expected). The two times it failed to load, I also got this error:

Uncaught Error: uniqName_4: parser returned unfilled promise (probably waiting for module auto-
load), unsupported by _WidgetsInTemplateMixin.   Must pre-load all supporting widgets before
 instantiation.

    f._beforeFillContent @ _WidgetsInTemplateMixin.js:3
    p.buildRendering @ _AttachMixin.js:2
    n @ init.js:106
    n.buildRendering @ _TemplatedMixin.js:4
    z.create @ _WidgetBase.js:5
    z.postscript @ _WidgetBase.js:4
    (anonymous function) @ init.js:108
    createWidget @ Controller.js:527
    g._hitchArgs @ init.js:176
    ha @ init.js:32
    (anonymous function) @ init.js:33
    ia @ init.js:33
    fa @ init.js:33
    g @ init.js:35
    (anonymous function) @ init.js:40

Honestly, it happens so infrequently now (and still only when I do multiple successive refreshes) that I don't really consider it worth much time.

mgd722 avatar Sep 10 '15 18:09 mgd722

@mgd722 That's the same error as in the OP which is a timing thing. I'll keep this issue open to track.

tmcgee avatar Sep 10 '15 19:09 tmcgee

I tested removing the lang="es-ES" attribute from the html tag but the problem persists.

chernandezCenipalmaOrg avatar Sep 10 '15 20:09 chernandezCenipalmaOrg

@chernandezCenipalmaOrg are you using the content attribute or the href attribute? From @mgd722 tests, it appears the html attribute maybe more reliable for loading the contents of the ContentPane.

tmcgee avatar Sep 12 '15 19:09 tmcgee

@tmcgee I'm using the href attribute.

chernandezCenipalmaOrg avatar Sep 14 '15 13:09 chernandezCenipalmaOrg

@chernandezCenipalmaOrg Have you tested to see if your issue is occurring in different browsers? If so, in which browsers have you experienced it? I am wondering if this is specific to one browser (like Internet Explorer 9). Thanks for any input you can provide.

tmcgee avatar Sep 19 '15 20:09 tmcgee

@tmcgee I use Google Chrome 45.0.2454.93. I also tested with FireFox 40.0.3 and IE 10, and it works perfectly on them. The Issue seems specific to Chrome.

chernandezCenipalmaOrg avatar Sep 21 '15 13:09 chernandezCenipalmaOrg

I'm on Chrome as well (version 45.0.2454.85 m). I haven't tested it thoroughly enough to comment on any other browsers.

mgd722 avatar Sep 21 '15 15:09 mgd722

This message only appears for me when using the compact build of the esri JS api, do others have the same behaviour?

sc-soln avatar Nov 25 '15 23:11 sc-soln

I was having this issue with my custom widgets... been bugging me for months... i put in a small fix by setting a timeout after each widget instantiation which averted the problem 70% of the time. Changing from the compact version of 3.14 to the full version...fixed the problem. Pretty annoying, shouldn't be hard to compact your files correctly..

tjones08 avatar Dec 28 '15 21:12 tjones08

I'm aware this is an old issue but it still happens. Both this and the decimalFormat error stem from the same issue: For some reason, ESRI's JS API and its included Dojo library sometimes fails to load the localization module, which makes the ContentPanes in the template fail during postMixinProperties as it tries to localize the "Loading..." notice. It's hard to repro because it doesn't always happen even within the same browser and build. Fortunately, switching away from compact fixes it.

Kyte avatar May 11 '17 17:05 Kyte