Reputation: 591
Why is nonce
undefined while debugging both in Chrome and Edge?
Setup:
Libraries:
Upvotes: 0
Views: 97
Reputation: 2782
You have __webpack_nonce__
set in the script tag, so it's not undefined
, and it's a global variable available everywhere in your code.
However, you check the type of the options.attributes
which you don't pass to insertStyleElement
:
Therefore, {}.nonce === undefined
Looks like the easiest way to fix it is to remove the additional if (typeof attributes.nonce === "undefined")
check, or to make sure you pass it when calling insertStyleElement
.
Upvotes: 0