Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Document.currentScript is null when executed in a module or with eval #6149

Open
TrevorKarjanis opened this issue Nov 28, 2019 · 0 comments
Open

Comments

@TrevorKarjanis
Copy link

Document.currentScript is null when executed in a module or with eval. This results in an exception on line 14 in prefixfree.js. I understand that the limitations state, "Prefixing code in @import-ed files is not supported." However, I am not sure if that refers to the CSS or the -prefixfree source. Applications run in environments like StackBlitz are bundled or executed with eval where Document.currentScript is always null. This reproduction using -prefixfree and conic-gradients performs a null check.

var currentScript = document.currentScript;
var self = window.StyleFix = {
	optIn: currentScript && currentScript.hasAttribute("data-prefix"),

v1.0.10

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant