Share

LinkedIn

Sitecore Page Editor’s Mysterious “an Error Occurred” Dialog

A quick read (and perhaps headache saver) for those experiencing the same odd debugging roadblock I encountered.

Recently I was converting a demo site from Web Forms to Sitecore MVC. I didn’t get very far before I ran into this mysterious and completely unhelpful (and misspelled) error:



This error appeared after attempting to add a component to the page in Page Editor mode. I couldn’t for the life of me figure out what was wrong. I only had a simple layout with some placeholders.

The problem only appeared in Chrome, so I considered logging it as a bug with Sitecore support. However, the problem did not appear with the sample layouts. I created MVC versions of those layouts and still the problem did not appear.
I started deleting code from my layout that I was sure couldn’t possibly be a causing the problem. I was wrong. It turns out that the problem was caused by the following tag:

<link rel="shortcut icon" href="" />

Why this tag was present with an empty href attribute, I can’t say. Adding any value to the href attribute fixes the problem. If rel=”stylesheet” the problem does not appear either.

I was amazed that this would cause the page editor to break. It makes me wonder if there is any other seemingly innocuous HTML that could break the page editor like this. Hopefully this post will save someone else the hours that I spent trying to locate the source of this error.

Sitecore development, Sitecore custom code

Comments

Add a Comment

*
*

Please confirm you are human by typing the text you see in this image:

TimTC said: 1/29/2015 at 5:49 AM

If this doesn't work for you, be sure to check https://kb.sitecore.net/articles/847744