Why Does window.exports Unexpectedly Exist?
We ran across an issue where window.exports
was being unexpectedly set.
The cause
<div id="exports">
...
</div>
Why?
In some browsers, DOM elements with id
s are available as variables automatically on window
. When combined with functionality that checks if window.exports
exists as part of environment detection there’s the potential for an issue.
See https://stackoverflow.com/questions/3434278/do-dom-tree-elements-with-ids-become-global-variables for more details.