Failed to execute 'write' on 'Document - Amazon One Link JS

(Pooja Patel) #1

Currently i have pasted One link JS code given by amazon as below place.

click to “Edit CSS/HTML” and paste amazon JS code in “Common CSS” body section tab.

I am getting this type or error in google chrome > F12 > console.

Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.`

v.createDiv	@ one.js
render	@	onejs
(anonymous)	@	onejs

anyone has idea of above error for amazon JS file?

(Régis Hanol) #2

Can you share what you pasted? (make sure you remove any personal code/id)

(Pooja Patel) #3

(Régis Hanol) #4

Does it work if you remove <!DOCTYPE html> ?

(Pooja Patel) #5

If i remove then showing error as below. Saved the js code as below format.

When i try test in Chrome > F12, Got below errors.

(Régis Hanol) #6

I think this is due to CSP. @xrav3nz, can you confirm?


No, this is not CSP.

Could you @PoojaPatel try removing the async in the script tag you pasted into the theme? i.e.

- <script async src="//"></script>
+ <script       src="//"></script>

And I believe the Cannot read property 'id' of undefined is a separate issue and has been fixed by Joffrey. Upgrading to latest should resolve the issue.

(Pooja Patel) #8

I have update the discourse into latest version and problem is resolved now.

Thank you to all for your kind support.