boardgamegeekjsclient
boardgamegeekjsclient copied to clipboard
Getting invalid keyword error on 'bgg.search.query' in production
Project background:
NextJS 13 Typescript Using bgg.search.query
bggClient.search.query({ query: value, type: ['boardgame', 'boardgameexpansion'] })
.then((queryResults) => {
// eslint-disable-next-line no-console -- cuz
console.log('not results problem', queryResults)
// eslint-disable-next-line no-debugger -- deal with it
debugger;
//...
I can never get console to log 'not results problem' it seems like the interface may have changed or something is wrong with the search.
XML response from rest client
Example code that will fail in next13
console.log(bggClient)
bggClient.search.query({ query: 'Monopoly' })
.then((r) => {
// eslint-disable-next-line no-console -- is client made?
console.log(r)
})
.catch((error) => {
// eslint-disable-next-line no-console -- cuz
console.log('search error:'error)
})
What is very odd is when I run locally npm run dev it seems to work fine with no issues, my error ONLY occurs when I run in production mode. The test code above returns 'search error' Invalid keyword
Debugging next production is extremely difficult so I can't help much more than this unfortunately. I am trying to get this project out soon. If I could get some help with this that would be great or I will have to wrap my own APIs for the search functionality.
I also tried other calls, like 'hot' and 'thing' and they seem to work fine in production mode. Seems to be an error with search from what I can tell.
Console when running locally
@LearningProcesss is this still an active project? or should I fork and fix myself
@LearningProcesss is this still an active project? or should I fork and fix myself
Hi, which version are you using?
It's actually the same in Angular production mode. In Dev everything works fine. In production, I see the XML response from BGG API in network, but then, nothing happens. No console logs, nothing.
The reason for this seems to be the jackson-js library and its annotations. Using parts of the code of this repository with a custom parsing instead of jackson-js works fine in Angular production mode.