we recently migrated to Sitecore 9.1 from 8.1 and we see a bunch of JS errors on the page only in experience editor mode. I dont see them happening in the normal mode.
I tried replacing the Sitecore vanilla js files - still the same.

there are two majors errors that I see getting repeated all over :

Uncaught TypeError: Cannot read property 'hide' of undefined


Uncaught TypeError: Cannot read property 'replace' of undefined

Any idea why this might happen?

enter image description here

  • Do you use prototype/jQuery libraries on your website? If yes, then make sure that you use no-conflict mode kb.sitecore.net/articles/286042 My assumption that should be checked: newer version of Sitecore scripts conflicts with yours.
    – Anton
    Jul 10 '19 at 20:53
  • Are you using VueJs for front end? If yes then you can use my recent research... sitecore.stackexchange.com/questions/22108/… Sep 27 '19 at 8:11
  • Also try just removing JS references from Exepreince editor and you will see you won't get these error anymore Sep 27 '19 at 8:12
  • Did you ever find a solution to this? We are also seeing it.
    – Hos
    Dec 18 '19 at 11:23

For us, the problem was an Html.Glass().Editable(...) inside the href of a link. That did not break the Experience Editor in Sitecore 8.1.

The init method of Sitecore.PageModes.ChromeManager throws an error, the initialization fails and the Experience Editor is unusable. That is the first error:

Uncaught TypeError: Cannot read property 'replace' of undefined

To find that, I used the Google Chromes DevTools (Firefox did not work for me). I added a logpoint on line 8347 ($sc.removeTags(this.fieldValue[0].defaultValue.replace(...)) inside Sitecore.PageModes.ChromeTypes.Fields load method and logged the following:

'fieldValue[0].id:', this.fieldValue[0].id

Now, reload the Experience Editor and look for the last id before the uncaught error.
Search for that id in your HTML using DevTools.

P.S.: You may have multiple sources for that error.


I encountered this error when a rendering's Data Source item had a Rich Text field with an unexpected block of Experience Editor markup saved within it. Removing the <span> corrected the issue.

<h4 class="intro-text__st">
  <span class="scWebEditInput scEnabledChrome" id="fld_088A0897B36B48109A41F9D93AC6F128_0933D4A1A5A64D869F1D25E895A882D6_en-US_5_e2a300701f2b4a5fb416ec392e1ba447_34548_edit" data-gramm_id="755be28e-d171-2160-44fd-4ef64349b224" data-gramm="true" spellcheck="false" data-gramm_editor="true" contenteditable="true">
    Our actual HTML content.

See L1NU5's answer to help identify which rendering has the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.