Skip to content


Subversion checkout URL

You can clone with
Download ZIP


ReferenceError: 'navigator is not defined' in node-webkit #223

Soviut opened this Issue · 6 comments

2 participants


I tracked this down to here

Because node-webkit is using a browser to run code on the desktop, it confuses the isBrowser check.

It would be good if there was an explicit way of defining the environment.


I was able to deal with this by overriding the isBrowser function in the code that requires it and making it always return false:

var aws = require('aws-sdk');
aws.util.isBrowser = function() { return false; };

This feels hacky and prone to failure in the future, so some kind of explicit override would be nice.


Can you provide more information about when you are getting this error? A stack trace would be helpful (printing err.stack).


node-webkit is a chrome-less webkit browser that lets you create desktop apps using html,css and js but with access to local node libraries and functions, so my angular app can list my file system using fs for example.

The problem is that because node-webkit acts as both a local app and a browser, it confuses the aws library, leading it to believe it's running in a browser when I want it to run as a local application. Because node-webkit is considered local, it has no navigator object defined, and the aws library, which thinks I'm in a browser, but with no navigator, throws a reference error.


Can you provide the stack trace for this exception?


@lsegal For whatever reason, while reverting back to an older version of my code, I can't reproduce the issue anymore.


I'm going to close this, then. If you find a way to provide steps to reproduce or an exception that is raised, feel free to re-open this or create a new issue. I'd be happy to look through and see what we could do about fixing it.

Glad you got it working, though.

@lsegal lsegal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.