I have script which depends on a window attribute to be loaded:
sync head() {
if (window.loadScript) { // window is not defined
return {
script: [
{
src: "https://some-api.com/min.js",
type: "text/javascript",
callback: function () {
console.log("loaded")
},
},
],
}
}
},
This results in:
window is not defined
error.
If this is not possible, whats the alternative?