You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just begun using NW.js alongside vue.js for a project. When attempting to declare vue via the node require method, I found three issues relating to the navigator, document and DocumentFragment objects, which I'm guessing relates specifically to NW.js but perhaps also other projects as well.
Each of the above object references in the vue.common.js file need to be prefixed with window.. For example:
window.navigator
window.document
window.DocumentFragment
Failure to do so will result in an undefined error, like this: Uncaught ReferenceError: navigator is not defined
As @Teevio mentioned in my forum post, it would seem that NW.js only makes these variables available explicitly via the window object. This could be because NW.js provides it's own Window object, which is a wrapper of the DOM’s window object (see here).
The text was updated successfully, but these errors were encountered:
I've just begun using NW.js alongside vue.js for a project. When attempting to declare vue via the node
require
method, I found three issues relating to thenavigator
,document
andDocumentFragment
objects, which I'm guessing relates specifically to NW.js but perhaps also other projects as well.Each of the above object references in the vue.common.js file need to be prefixed with
window.
. For example:window.navigator
window.document
window.DocumentFragment
Failure to do so will result in an undefined error, like this:
Uncaught ReferenceError: navigator is not defined
As @Teevio mentioned in my forum post, it would seem that NW.js only makes these variables available explicitly via the
window
object. This could be because NW.js provides it's ownWindow
object, which is a wrapper of the DOM’swindow
object (see here).The text was updated successfully, but these errors were encountered: