Why do I see so many console errors and warnings in the story map templates?

2372
5
06-15-2017 07:35 AM
mfcallahan
Occasional Contributor II

I'm currently helping some of the GIS Analysts in my department implement HTTPS in their story maps, and I'm noticing that every ArcGIS Online app/map/story map is continuously throwing all sorts of console errors and warnings and logging all sorts of random debug info.  Here's what I see when I open an empty journal story map template:

Why is this happening in production code?  Are all these errors and random output in the console typical of a default AGOL map/app?  Some of the completed story maps I've looked at appear to be functioning normally, yet there's a continuous stream of errors and warnings in the console as I navigate the page which is concerning.

0 Kudos
5 Replies
OwenGeo
Esri Notable Contributor

Hi Matt -- Sorry you are having an issue with console messages and Map Journal, but am glad to hear most of your other stories are working as expected.

Below is what I see in the console when I open the Map Journal app. What you are seeing is certainly not expected or typical when Map Journal builder first opens. Is it possible that your organization has a logo image configured in its shared theme that is not shared properly? Could you please post a screenshot that includes the app and browser address bar?

Owen

Owen Evans
Lead Product Engineer | StoryMaps
mfcallahan
Occasional Contributor II

I wasn't referring to the Story Map Builder page in my original post (though it is also littered with console errors and random debug output).  I'm receiving these errors when viewing the live application - what my clients will see.  Here is a collection of screenshots displaying the browser console for various story map templates:

AGOL Story Map Template Console Errors - image gallery

I first uploaded a shapefile of sample points to AGOL to create a hosted feature layer, and then I added that layer to a simple web map which would be used in each Story Map Template demo.  There is no shared organizational shared content or themes, I'm literally just opening an empty story map template, adding my map, and nothing else.  Every story map template I've used continuously throws all these errors and warnings in Chrome 58, Firefox 53, IE 11, and Edge 40.  If story maps were working as expected, my console should look like this - no unhandled errors in minified files, no debug output, no warnings about Synchronous XMLHttpRequests (callbacks...use them!!!)

0 Kudos
OwenGeo
Esri Notable Contributor

Hi Matt,

It looks like you are using the same map in all of those tests. I can open many story maps from the gallery and not see any errors (although I do see messages and some warnings), so there appears to be something about your map or a layer it contains that is causing those errors.

We have heard that some developers and power user authors find the error messages helpful to know when resources aren't shared/available, and the vast majority of people reading story maps don't use their browser with dev tools open, so these messages don't have any impact on their experience.

Originally, in the first releases of Map Journal/Series, these messages didn't appear, but we ran into a tech limitation with one of the plugin libraries used in our apps when suppressing the messages so we added them back. It wasn't our preference to do that, but we haven't had any complaints about them until now, so it seems most people don't have the strong negative reaction to them that you have vocalized here.

That being said, we hear that you'd appreciate if we would handle these messages differently. We'll look into minimizing what messages get displayed in the console and will consider otherwise hiding all messages and adding a "debug" URL parameter that devs can use to turn the messages on. This URL parameter is already implemented in Story Map Crowdsource (beta), and we will look to implement it in our new apps. For example, compare the console output from these two links:

Thanks for your feedback.

Owen

Owen Evans
Lead Product Engineer | StoryMaps
mfcallahan
Occasional Contributor II

Error messages are useful for devs, but when the errors are occurring in the minified API modules it is extremely difficult to understand or resolve the errors.  If my map or the layer in the map is causing the issues, the errors I'm seeing aren't making resolving that issue any easier.  The map does not throw any errors when opened by itself, so I'm not sure what settings to tweak to fix the errors in the story map.  But it's not just my maps - here's a public facing app I found that throws similar errors.  If something in a map is causing these errors, it's not being made clear to the user and they will end up with story maps throwing these errors and warnings like this.

the vast majority of people reading story maps don't use their browser with dev tools open, so these messages don't have any impact on their experience.

Sorry, I don't mean to be rude but I really have to take issue with this statement.  Yes, most people don't look under the hood, but that's not really a great excuse to sweep errors in the client side code under the rug or diminish the importance of resolving them.  How do we know for sure these errors aren't having any impact on the user's experience? (The Synchronous XMLHttpRequest warning is literally stating that it has detrimental effects to the end user's experience...)  If there are errors being thrown in the console, the application is not working correctly.  I'm glad there will be a debug option in future story map revisions. Following best web dev practices, I remove all console output from my applications as there may be situations where console is not defined on the client.

0 Kudos
NiklasKöhn
Esri Contributor

Hi Matt,

your question is already a few days old, but let me add an idea: Your gallery shows a lot of "Token required" and "no permission" errors in your application, not the JS errors you see when you have issues in your code (like when referencing a property on an "undefined" object). It looks to me like there is some element that the end user is not allowed to see. I can't tell you what it is, because usually those messages refer to protected map layers, maybe some service used in the back, but as far as I can see you're only using one layer which is visible. Furthermore, you still seem to be logged in, which makes it even more strange that you shouldn't be allowed to see some of your stuff. And as your app is still on ArcGIS Online and not on your own web server, there's only so much you can do.

Maybe some path to a background reference is being messed up when creating the app. This would be a question to AGO or JS guys (like Rene Rubalcava‌, who is usually very helpful on GeoNet).

If you'd like to do some more research, here's what I try in these situations: Try downloading the app and hosting it on your own web server (local IIS, node.js or something). Register the app with your AGO subscription so your credentials are passed through to the web map and all referenced items. If this doesn't help, you can also implement the JS proxy page and play around with that, maybe you can find something out. (Doesn't help if you want AGO to host the final version of your app though.)
Good luck!
Nik