"Uncaught Loaded unexpected element while trying to get rendering HTML from server. Expecting last tag to be closing script marker" in Sitecore Angular JSS version 10.1

enter image description here


I have got this error in Sitecore Angular JSS version 10.1 when the component gets added in Experience editor mode.

Following are the reasons for the error to occur:

  • Without null check for rendering property value and when it's getting to bind empty property.

  • When the rendering(HTML) is having a comment section with a conditional statement sometimes breaks in HTML.

<!--<ng-template #elseStatement> Unused Logic </ng-template> -->


  • Always add null check even if the field is required in Sitecore.
  • Remove unwanted commented lines from HTML.

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.