Skip to content

ReferenceError: navigator is not defined #19

@city41

Description

@city41

I am getting this error from inside the cognito module:

at CognitoUser.authenticateUserInternal (/var/app/current/node_modules/amazon-cognito-identity-js/lib/CognitoUser.js:383:19)

It looks like Amazon wrote these modules assuming they will run in a browser.

I worked around this by adding global.navigator = {} just before calling passport.use(new CognitoStrategy(...)). Not thrilled about adding a global, but it works.

Figured I'd post this here in case anyone else stumbles upon this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions