Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

400
Visualizações
Invariant Violation: 29 on react apollo grapql

What does this error mean? Invariant Violation: 29 (see https://github.com/apollographql/invariant-packages) did I miss something on my code that trigger this error? does anyone knows what does this error mean?, I've encounter this error when i tried to import the LocationSearch component to my index.js

import { LocationSearch } from '../component/LocationSearch';

<LocationSearch
   freeSolo
   withIcon={false}
/>

../component/LocationSearch.js

import { GETSTUDENTLOCATION } from '../../utils/location.gql';
const propTypes = {
   withIcon: PropTypes.bool,
}
const defaultProps = {
   withIcon: true,
}
const LocationSearch = ({
   withIcon,
})=>{
  const [getStudentLocations] = useQuery(GETSTUDENTLOCATION);

  const onChangeHandler = (e, value) => {
    onChange(value);
    const { valid, error } = isValid(value);
    if (!valid) {
      onError(error, value);
    }

    setOpen(false);
    setOptions([]);
  };

  const onInputChangeHandler = (e, inputString, reason) => {
      setKeyUpTimeOut(
        setTimeout(async () => {
          setLoading(true);
          const { data: searchLocation } = await getLocations({
            variables: {
              placeSearch: {
                address: inputString,
              },
            },
          });
          setLoading(false);
          setOptions(searchLocation.findLocationByAddress || []);
          setOpen(true);
        }, 500)
      );
  };


<Autocomplete
    onChange={onChangeHandler}
    onClose={onClose}
    onInputChange={onInputChangeHandler}
    open={open}
    options={uniqBy(
       multiple
       ? [...options, ...value]
       : value
       ? [...options, value]
       : options,
       'name'
    )}
/>
}

../../utils/location.gql

export const GETSTUDENTLOCATION = gql`
  query SearchStudentLocation($placeSearch: Location!) {
    searchstudentlocation(placeSearch: $placeSearch) {
      student_name
      address {
        street1
        street2
        city
        barangay
        houseNumber
        port
      }
      remarks
    }
  }
`;
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I think its because of the version of your apollo-client

about 4 years ago · Juan Pablo Isaza Relatório

0

I encountered the same problem and in the apollo source you can see interpretation of this error as:

Could not find "client" in the context or passed in as an option. Wrap the root component in an <ApolloProvider>, or pass an ApolloClient instance in via options.'

In my case I forgot to use <ApolloProvider>. Once I wrapped the application in it (and checked that the passed in client actually exists) everything worked as expected:

{ apollo &
  <ApolloProvider client={apollo}>
    <!-- application logic -->
  </ApolloProvider>
 }
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda