You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/10/25 11:30:20 UTC
[GitHub] [couchdb-nano] insidewhy opened a new issue, #306: After updating to nano 10.0.0 no requests work due to `Error: Response for preflight has invalid HTTP status code 405`
insidewhy opened a new issue, #306:
URL: https://github.com/apache/couchdb-nano/issues/306
We've been using nano 8 and 9 for a while and everything was working well. Since switching to nano 10 even the most basic request doesn't work:
```typescript
import Nano from "nano";
const nano = Nano("http://localhost:5984");
const nano = Nano("http://localhost:5984");
await nano.db
.use("beacons")
.insert({
_id: new Date().toString(),
})
.then(() => {
console.log("created");
})
.catch(e => {
console.log("error", e);
});
```
Everytime we get a log `Error: error happened in your connection. Reason: Network Error`. We also see this console message logged:
```
Error: Response for preflight has invalid HTTP status code 405
```
After further debugging it looks like axios is sending an `OPTIONS` request first, but couch doesn't support `OPTIONS` hence the `405`.
Our couchdb config looks like this:
```
[log]
level = error
writer = stdout
[cluster]
n=1
q=1
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-nano] insidewhy commented on issue #306: After updating to nano 10.0.0 no requests work due to `Error: Response for preflight has invalid HTTP status code 405`
Posted by GitBox <gi...@apache.org>.
insidewhy commented on issue #306:
URL: https://github.com/apache/couchdb-nano/issues/306#issuecomment-1290432976
Ah we were inadvertently using `jsdom` in our server tests (it's the default unless you set `testEnvironment` to `node` in the config. It was hijacking the routines used by axios which forced the preflight request. Very annoying :D
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-nano] insidewhy closed issue #306: After updating to nano 10.0.0 no requests work due to `Error: Response for preflight has invalid HTTP status code 405`
Posted by GitBox <gi...@apache.org>.
insidewhy closed issue #306: After updating to nano 10.0.0 no requests work due to `Error: Response for preflight has invalid HTTP status code 405`
URL: https://github.com/apache/couchdb-nano/issues/306
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org