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

Error: Invalid AST Node: null. - NUXT3 #564

Open
alessioraggioli opened this issue Nov 2, 2023 · 1 comment
Open

Error: Invalid AST Node: null. - NUXT3 #564

alessioraggioli opened this issue Nov 2, 2023 · 1 comment
Labels

Comments

@alessioraggioli
Copy link

Environment

"@nuxtjs/apollo": "^5.0.0-alpha.8",

Describe the bug

Sometimes I get randomly this error when trying to call graphql method.

I have a composable function

export async function GQL_REQUEST(query) {
  try {
    const { data, refresh, error } = useAsyncQuery(query)
    if (!data.value) {
      //on alpha.5 bug fixing, forse puoi rimuovere appena passa a beta/stable
      return refresh()
        .then(() => {
          return JSON.parse(JSON.stringify(data.value))
        })
        .catch((err) => {
          log('////////GRAPHQL ERROR REFRESH METHOD', true)
          log(query.loc.source)
          log(err)
        })
    } else {
      return data.value
    }
  } catch (err) {
    log('////////GRAPHQL ERROR AT INIT', true)
    log(err)
  }
}

this is the error in console

Error: Invalid AST Node: null.
at devAssert (devAssert.mjs:5:11)
at visit (visitor.mjs:168:23)
at print (printer.mjs:10:10)
at prep (composables.mjs?v=03ae6653:24:47)
at useAsyncQuery (composables.mjs?v=03ae6653:7:23)
at GQL_REQUEST (gqlRequest.js:3:38)
at Proxy.getDocumentByTipoUd (index.js:134:20)
at Proxy. (pinia.mjs:1362:30)
at store. (pinia.mjs:915:40)
at index.vue:329:37

Expected behaviour

query works

Reproduction

No response

Additional context

No response

Logs

No response

@alessioraggioli alessioraggioli changed the title Error: Invalid AST Node: null. Error: Invalid AST Node: null. - NUXT3 Nov 2, 2023
@pschaub
Copy link
Contributor

pschaub commented Dec 25, 2023

Could you provide a complete example of how to reproduce this issue? The example you mentioned does not seem to be complete, as e.g. the query is not specified and could possibly be the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants