cancel
Showing results for 
Search instead for 
Did you mean: 

Element 'script', attribute 'crossorigin': The attribute 'crossorigin' is not allowed.

Highlighted

Element 'script', attribute 'crossorigin': The attribute 'crossorigin' is not allowed.

Hi,

I am using magento 2.3.3-p1 and when i put my site into developer mode i get the error:

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'script', attribute 'crossorigin': The attribute 'crossorigin' is not allowed.
Line: 52

I wanrt to use the Font Awesome 5 js from their cdn instead of manually uploading the files each time a new version is released so i add this to default_head_blocks.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <head>
	<script src="https://kit.fontawesome.com/<my-id>.js" crossorigin="anonymous" src_type="url" />
  </head>
</page>

How do i enable crossorigin?

 

I have tried adding

<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css|js|gif|png|jpe?g|svg|svgz|ico|webp)$">
        Header set Access-Control-Allow-Origin "*"
	Header set Access-Control-Allow-Headers "X-Requested-With"
    </FilesMatch>

under the mod_headers section of .htaccess in the root of my magento install, as well as trying it in the pub/.htaccess and pub/static/.htaccess with no luck. 

 

In default and production mode i dont have this error and font awesome works fine.