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

Getting invalid keyword error on 'bgg.search.query' in production #53

Open
ZinkNotTheMetal opened this issue Sep 23, 2023 · 6 comments
Open

Comments

@ZinkNotTheMetal
Copy link

ZinkNotTheMetal commented Sep 23, 2023

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
image

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

image

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.

@ZinkNotTheMetal
Copy link
Author

Console when running locally

image

@ZinkNotTheMetal ZinkNotTheMetal changed the title Getting invalid keyword in production Getting invalid keyword error on 'bgg.search.query' in production Sep 24, 2023
@ZinkNotTheMetal
Copy link
Author

@LearningProcesss is this still an active project? or should I fork and fix myself

@LearningProcesss
Copy link
Owner

@LearningProcesss is this still an active project? or should I fork and fix myself

Hi, which version are you using?

@LInsoDeTeh
Copy link

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.

@LInsoDeTeh
Copy link

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.

@LearningProcesss
Copy link
Owner

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.

Thank you for sharing your analysis, unfortunately jackson-js library is causing considerable inconvenience however as yet I have not found a viable alternative.
Would it be possible for you to share the custom parsing code used?

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

3 participants