Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signup Error: undefined Can't find variable: localStorage #4890

Closed
pulkitsapra opened this issue Jul 12, 2018 · 0 comments
Closed

Signup Error: undefined Can't find variable: localStorage #4890

pulkitsapra opened this issue Jul 12, 2018 · 0 comments

Comments

@pulkitsapra
Copy link

pulkitsapra commented Jul 12, 2018

Issue Description

When i try to signup using the following code

import ParseReact from 'parse-react/react-native';
import Parse from 'parse';

Parse.initialize(
  'myAppId',
);
Parse.serverURL = 'http://localhost:1337/parse';

async setnewuser(username , password){
    var user = new Parse.User();
    user.set('username',username);
    user.set('password',password);
    alert(user)

    user.signUp(null, {
    success: function(user) {
      // Hooray! Let them use the app now.
    },
    error: function(user, error) {
      // Show the error message somewhere and let the user try again.
      alert("Error: " + error.code + " " + error.message);
    }
   });
  }
    

I get the error as "undefined: Can't find variable:localStorage"

Can someone help in resolving this issue. I use parse server 1.11.1

********UPDATE ******
I installed package localstorage-polyfill
import 'localstorage-polyfill'
and it works fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant