an abstract image of a grid adhering to waves with various spotlights of teal and purple

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



Ben Golden
Ben Golden

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.

Let's Get Started

We'd love to hear from you. We probably have a lot in common. I mean, you like chatting about data-binding, UX patterns, and javascript functions, right?

X

Cookies help us improve your website experience. By using our website, you agree to our use of cookies and our privacy policy.

Accept