isotoma / react-cognito

Library for integrating Facebook React and Amazon Cognito
Apache License 2.0
116 stars 48 forks source link

"Require is not defined" #17

Open Strainy opened 7 years ago

Strainy commented 7 years ago

Hi all,

Having trouble getting set up. When importing anything from react-cognito into my project I'm getting a "Require is not defined" error. Here are the steps I've taken to install:

  1. Install react and react-dom 15.4.2
  2. npm install --save-dev react-cognito
  3. npm install --save-dev amazon-cognito-identity-js

Am I missing anything here? Have just followed the docs at: https://doc.esdoc.org/github.com/isotoma/react-cognito/manual/installation/install.html

dibell commented 6 years ago

Require is build into node. What version of node are you using? Try the new react-cognito-example repo.

ajhool commented 6 years ago

This error commonly occurs when you are trying to execute node.js in the browser.

You may be interested in browserify (http://browserify.org/) or including