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

POST succeeds only at first try. Further tries fail consistently. #411

Closed
accidentalrebel opened this issue Nov 19, 2016 · 4 comments
Closed

Comments

@accidentalrebel
Copy link

When I do a POST request for the first time, the request pushes through with no problems. But if I do it a second or more times, it consistently fails.

Here is the log of the results:

POST /facebookGroups/ 201 25.756 ms - 28
TypeError: doc.hasOwnProperty is not a function
at C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\underscore-db\src\index.js:36:15
at baseFindIndex (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\lodash\lodash.js:823:11)
at findIndex (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\lodash\lodash.js:7260:14)
at Function.find (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\lodash\lodash.js:5124:21)
at Function.getById (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\underscore-db\src\index.js:35:17)
at Function.insert (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\underscore-db\src\index.js:48:18)
at C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\lodash\lodash.js:4405:28
at arrayReduce (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\lodash\lodash.js:704:21)
at baseWrapperValue (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\lodash\lodash.js:4404:14)
at LodashWrapper.wrapperValue (C:\Users\ARebel\AppData\Roaming\npm\node_modules\json-server\node_modules\lodash\lodash.js:9052:14)
POST /facebookGroups/ 500 21.789 ms - 1272

The only way for me to send a POST request again is to restart the server. After that, the request succeeds once, then fails again afterwards.

For some reason, it seems to be looking for 'doc.hasOwnProperty" which I have no idea why it only does so the second time.

I'm also not doing anything special, just using Curl in Haxe shown below:

var r2 = haxe.Curl.post("http://localhost:3000/facebookGroups/", "test=1");
trace("POST" + r2);

I'll add that this same thing happens with just plain old Http requests (No cURL).

Hope someone can help me out.

Thanks!

@JustASquid
Copy link

I'm also running into this issue with the same symptoms (although it's quite possible I'm just doing something wrong).

@EternalFire
Copy link

Try to install previous version, please.
npm install [email protected].*

It works.

@typicode
Copy link
Owner

Hi @accidentalrebel,

Thank you for the report.
I've published v0.9.1 with a potential fix, let me know if you still have this issue.

@accidentalrebel
Copy link
Author

This is confirmed fixed on v0.9.1. Thanks a lot, @typicode!

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

5 participants
@accidentalrebel @typicode @JustASquid @EternalFire and others