guillaumebriday / todolist-frontend-nuxt

Front-end application for Todolist Web application built with Laravel and Nuxt.js
https://todolist-nuxt.guillaumebriday.me
MIT License
26 stars 4 forks source link

Login or Register not working upon fresh install #7

Closed connecteev closed 5 years ago

connecteev commented 5 years ago

Go to http://localhost:49229/register Enter details and try to register...nothing happens.

Error in console:

register.js:269 Uncaught (in promise) TypeError: Cannot read property 'data' of undefined
    at register.js:269

Same issue if you try to login at http://localhost:49229/login with Email : darthvader@deathstar.ds Password : 4nak1n

login.js:244 Uncaught (in promise) TypeError: Cannot read property 'data' of undefined
    at login.js:244

        _this.form.onFail(response.data.errors);

Screenshot: https://1ce.org/1#Hy8E176Wr

connecteev commented 5 years ago

Quick update here to make sure I wasn't doing something stupid. I did a fresh checkout of everything:

  1. Backend: https://github.com/guillaumebriday/todolist-backend-laravel Reran composer install and all scripts (migration, seeding, generation of keys, etc), and I have php artisan serve running on port 8000

  2. Front-end: Fresh pull of https://github.com/guillaumebriday/todolist-frontend-nuxt/ Reran npm install and npm run dev. This time, nuxt is running on port 3000 with no conflicts.

I then went to http://localhost:3000/register and try to register, but am seeing the same error in the console. 100% sure that something is broken here.

register.js: 269 Uncaught (in promise) TypeError: Cannot read property 'data' of undefined
    at register.js:269
connecteev commented 5 years ago

By the way, I also tried doing this: cp .env.example .env which wasn't in the README

guillaumebriday commented 5 years ago

Hum i think your error is related to the "the message port closed before a response was received".

I tried on my new MBP at work, I have no error both on Laravel and Nuxt.

Please check your development env as long as you don't want to use docker. If you're not sure what you're doing you can use the official homestead instead withou issue.

You can check if everything is working fine here : https://todolist-nuxt.guillaumebriday.xyz

guillaumebriday commented 5 years ago

Ok my bad, I've always tried with a PUSHER_APP_KEY in my .env but it fails when it's not defined.

Fixed in https://github.com/guillaumebriday/todolist-frontend-nuxt/commit/183195cdea655a3589910f74ae750cece2e308c4

connecteev commented 5 years ago

@guillaumebriday thanks for looking at it. We're past that error now This is what I now see in the console on register: http://localhost:8000/api/v1/auth/register 422 (Unprocessable Entity)

{message: "The given data was invalid.",…}
errors: {name: ["The name may only contain letters, numbers, dashes and underscores."]}
name: ["The name may only contain letters, numbers, dashes and underscores."]
0: "The name may only contain letters, numbers, dashes and underscores."
message: "The given data was invalid."
connecteev commented 5 years ago

Edit: Duh! My bad. I was entering my full name in the username field, so it had a space. It works :)