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

Production Search API Fails #234

Open
pbennett87 opened this issue Jan 14, 2025 · 2 comments
Open

Production Search API Fails #234

pbennett87 opened this issue Jan 14, 2025 · 2 comments

Comments

@pbennett87
Copy link

For some reason in the production build my search feature has stopped working

@pbennett87
Copy link
Author

It might be worth noting that the /dist/ folder has simply been uploaded to a simple http server, everything else works fine, just not the search, the console log states the following when typing a search term.

TypeError: Cannot read properties of undefined (reading 'body')
at sw_helpers.js:303:28

querySkySources: function (str, limit) {
    if (!limit) {
      limit = 10
    }
    return fetch(process.env.VUE_APP_NOCTUASKY_API_SERVER + '/api/v1/skysources/?q=' + str + '&limit=' + limit)
      .then(function (response) {
        if (!response.ok) {
          throw response.body
        }
        return response.json()
      }, err => {
        throw err.response.body
      })
  },

@pbennett87
Copy link
Author

I even hardcoded the api

querySkySources: function (str, limit) {
    if (!limit) {
      limit = 10
    }
    return fetch('https://api.noctuasky.com/api/v1/skysources/?q=' + str + '&limit=' + limit)
      .then(function (response) {
        if (!response.ok) {
          throw response.body
        }
        return response.json()
      }, err => {
        throw err.response.body
      })
  },

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

1 participant