fullstack-graphql-apollo-react-meteor icon indicating copy to clipboard operation
fullstack-graphql-apollo-react-meteor copied to clipboard

Issue creating a user, lesson 15

Open barbier opened this issue 5 years ago • 0 comments

Hello! During lesson 15 I believe to have followed all the instructions correctly, but when I try to create a user, I get the following errors, both on terminal and browser: /home/barbier/.meteor/packages/meteor-tool/.1.6.1.ovpzey.y0lrn++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node: symbol lookup error: /home/barbier/Documents/Projetos/leveluptuts-meteor/node_modules/bcrypt/lib/binding/bcrypt_lib.node: undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE => Exited with code: 127 => Your application is crashing. Waiting for file change.

SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data - socket-stream-client.js:2810:20 Source map error: SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data

My Component code:

import { Accounts } from "meteor/accounts-base"

export default class RegisterForm extends React.Component {
    registerUser = e => {
        e.preventDefault()

        Accounts.createUser(
            {
                email: this.email.value,
                password: this.password.value,
            },
            error => {
                console.log(`Error registering user: ${error}`)
            }
        )
    }

    render() {
        return <form onSubmit={this.registerUser}>
            <input
                type="email"
                ref={input => this.email = input}
                placeholder="Your email"
            />
            <input
                type="password"
                ref={input => this.password = input}
                placeholder="Desired password"
            />
            <button type="submit">Register User</button>
        </form>
    }
}```

Can you help me?

barbier avatar Oct 09 '18 16:10 barbier