Legacy Knowledge Base
Published Jun. 30, 2025

Blocked:origin errors are seen when deploying Spritemap CX

Written By

Dia Seung

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Blocked:origin errors are seen in the browser console when deploying Spritemap CX.
  • Theme SVG Spritemap is showing blocked:origin errors in a SaaS environment.
    blocked-origin.png

Environment

  • Liferay PaaS, SaaS

Resolution

  • Observing browser console (blocked:origin) errors is expected behavior.  As long as the spritemap icons are displayed properly, these errors can be disregarded.
    • This is due to the fact that there is no native support for cross-domain requests in <use> element. Liferay utilizes the <use> element to refer to individual icons inside the spritemap. When browser attempts to access the spritemap provided by the Theme Spritemap client extension, it emits the error of (blocked:origin).

    • As the same time, as Theme Spritemap CX enabled “cross domain support”, Liferay inserts a new piece of code, called svg4everybody ,which watches for occurrences of <use> elements in the page, and managing the requested icon by fetching it using a dedicated XMLHTTPRequest. This is the way cross-domain restrictions are bypassed.

    • Additionally the process of watching for occurrences and processing the icon is not run immediately but at intervals and can take time, potentially causing a “race” between two opposite forces:

      1. Browser paint cycles, where <use> elements trigger the request of a blocked resource

      2. svg4everybody injecting the icons whenever a <use> element is found

  • If the spritemap icons are not displaying properly, please first ensure "Enable Cross Domain Support" is selected when creating a new Theme SVG Spritemap. 
    If the icons are still not seen, please kindly open a Support ticket requesting fix LPD-34919

Additional Information

 

 

Did this article resolve your issue ?

Legacy Knowledge Base