-
Notifications
You must be signed in to change notification settings - Fork 74
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
TypeError: Cannot read property '2' of null #71
Comments
Update - Issue above was @ work. I tried to replicate @ home and got the following response. I will download dependencies @work again in case there was an issue I missed something. Dialect: mysql
|
Thank you for the detailed report. That last response looks more like what it should do. I'd say a dependency issue or a problem with the database. |
@daffl After reinstalling dependencies and seeing no issue - the same issue occurred :(. Sucks im really enjoying Feathers at home. super easy. So after more analysis I found the node version i'm using is v4.2.1 @ work. This is a red flag since FeatherJS documentation is stating node 5+ and if anything is below is required to use babel. This is the NPM Error I get below the first image I attached. Not sure if this is related to this issue but I will work on updating my node and see if that fixes the issue. @daffl what are the chances this is a due to babel not executing properly.. I have a feeling because @ work security is very strict.. I can't even update node without following a process.. |
That does look like a Babel error. It should work with Node v4 but with strict security restrictions it makes sense something during installation went wrong. I recommend using nvm to install the latest version and try that. You might want to re-initialize the application so that it doesn't enable Babel (this is only done for Node < 5). |
@daffl It seems to be mysql version issue. I originally opened issue at sequelize repository but was initially closed assuming it wasn't a sequelize issue but then recently reopened. Luckily the mysql version locally installed at work is version 5.6.15 didn't display this issue VS. the mysql 5.7.13 where I got this issue. I replicated both table structures and unique indexes as seen below. Sent a POST to create a new record and immediately sent the POST again to recreate the crash but this time the server did not crash and instead got a JSON error as expected. Expected Response with mysql version 5.6.15 |
Glad it is working. Can we close since it seems to be a Sequelize/MySQL issue? |
I'm going to close this, for now. @abartolo please reopen if you feel like there's something that can be done on our end. Thanks! |
Hello,
So I'm giving FeathersJs a try and so far its supper easy to create quick rest apis. However I am stuck on an issue when creating a duplicate record where the table column is unique. I came across this issue when testing since other application might want to send a POST request to create a record but it "email" for example might already be used.
What you are doing?
Creating a record with the same value in a column that is Unique:true. I successfully inserted new record via restful api using Postman. However if I send the same request again( create a user with the same email which the column is unique) it crashes the server with error "TypeError: Cannot read property '2' of null".
Below is the model I am using
What do you expect to happen?
I expected to get a response back with an error stating its a duplicate or at least a clean error.
What is actually happening?
Crashed server since error wasn't caught.
Error Image
Dialect: mysql
Database version: 5.7.13
Sequelize version: 3.24.4
The text was updated successfully, but these errors were encountered: