node-geocoder icon indicating copy to clipboard operation
node-geocoder copied to clipboard

OpenStreetMap // Node Error Body used already

Open LBeckX opened this issue 1 year ago • 7 comments

Hi, I am currently getting the following error with OpenStreetMap.

HttpError: body used already for: https://nominatim.openstreetmap.org/search?accept-language=de-DE&addressdetails=1&q=Erlanger Straße+91080+Deutschland&format=json

This is my implementation that worked before.


async function getGeoLocationAddresses(address: string) {
        const geocoder = NodeGeoCoder({provider: 'openstreetmap', email: '[email protected]', language: 'de-DE'})
        const response = await geocoder.geocode(address + ' Deutschland')
        if (!response[0]) {
            throw new Error(`Can not get geolocation - response is empty by address: ${address}`)
        }
        return response
}

LBeckX avatar Jun 18 '24 12:06 LBeckX

same here

SultanGabriel avatar Jun 18 '24 12:06 SultanGabriel

same here

loique avatar Jun 18 '24 15:06 loique

Been able to temporarly fix the issue by applying the changes from PR #346. What happens is that there is a bug in the error handling code which leads to an error and the actual error is not being logged.

SultanGabriel avatar Jun 18 '24 15:06 SultanGabriel

Same here, but we can still request the API

const response = await fetch(`https://nominatim.openstreetmap.org/search?addressdetails=1&q=${location.address.replace(" ", "+")}&format=json`)
const data = await response.json();

victordalet avatar Jun 21 '24 08:06 victordalet

The same issue is being faced here. Do we have any update if the issue is fixed or when can it be fixed? Thanks.

farrukh-educative avatar Jul 02 '24 09:07 farrukh-educative

The same issue is being faced here. Do we have any update if the issue is fixed or when can it be fixed? Thanks.

A fix already should exist for the bug PR #346. I haven't looked again if the PR got merged but you could copy the commit for a temporary fix, it's 4 or 5 lines that need changing

SultanGabriel avatar Jul 02 '24 10:07 SultanGabriel

Could you release the new version? The PR got merged 2 weeks ago already

isntfunny avatar Jul 05 '24 22:07 isntfunny

This has been released

nchaulet avatar Nov 30 '24 15:11 nchaulet