Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disclaimer box unreliably loading #10

Open
wrightgd opened this issue Apr 24, 2015 · 25 comments
Open

Disclaimer box unreliably loading #10

wrightgd opened this issue Apr 24, 2015 · 25 comments

Comments

@wrightgd
Copy link

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!

@tmcgee
Copy link
Owner

tmcgee commented Apr 24, 2015

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: cbdc2f8

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?

@wrightgd
Copy link
Author

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?

@tmcgee
Copy link
Owner

tmcgee commented Apr 28, 2015

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.

@mgd722
Copy link

mgd722 commented Jun 4, 2015

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.

@chernandezCenipalmaOrg
Copy link

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

@tmcgee
Copy link
Owner

tmcgee commented Sep 10, 2015

@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.

@chernandezCenipalmaOrg
Copy link

@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.

@tmcgee
Copy link
Owner

tmcgee commented Sep 10, 2015

@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

@mgd722
Copy link

mgd722 commented Sep 10, 2015

@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
Copy link

mgd722 commented Sep 10, 2015

@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.

@tmcgee
Copy link
Owner

tmcgee commented Sep 10, 2015

@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
Copy link
Owner

tmcgee commented Sep 10, 2015

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.

@mgd722
Copy link

mgd722 commented Sep 10, 2015

@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.

@chernandezCenipalmaOrg
Copy link

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

@mgd722
Copy link

mgd722 commented Sep 10, 2015

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.

@tmcgee
Copy link
Owner

tmcgee commented Sep 10, 2015

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

@chernandezCenipalmaOrg
Copy link

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

@tmcgee
Copy link
Owner

tmcgee commented Sep 12, 2015

@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.

@chernandezCenipalmaOrg
Copy link

@tmcgee I'm using the href attribute.

@tmcgee
Copy link
Owner

tmcgee commented Sep 19, 2015

@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.

@chernandezCenipalmaOrg
Copy link

@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.

@mgd722
Copy link

mgd722 commented Sep 21, 2015

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.

@sc-soln
Copy link

sc-soln commented Nov 25, 2015

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

@tjones08
Copy link

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..

@Kyte
Copy link

Kyte commented May 11, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants