Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
AWS Datastore not saving users in the database on Android

I have a code that will save user in the database on my profile screen, but the code worked fine on iOS, but on android it throws a "Possible unhandled Promise Rejection" with "TypeError: Symbol.asyncIterator is not defined." Please how can solve the issue on Android so that it can save to database? I am working with React Native. Here is the code snippet:

import {Auth, DataStore} from 'aws-amplify';

const ProfileScreen = () => {

    const [name, setName] = useState('');
    const [bio, setBio] = useState('');
    const [gender, setGender] = useState();
    const [lookingfor, setLookingfor] = useState();

    const isValid = () => {
        return name && bio && gender && lookingfor;
    };

    const save = () => {
        if(!isValid()) {
            console.warn('Not valid');
            return;
        }

        const newUser = new User({
            name,
            bio,
            gender,
            lookingfor,
            image: 'https://notjustdev-dummy.s3.us-east-2.amazonaws.com/avatars/elon.png',
        });

        DataStore.save(newUser);

    };
    return ...

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Accoding to the documentation, since save returns a promise instead of doing the opeartion itself, add await or subscribe with then to the save function;

await DataStore.save(newUser); 

or

DataStore.save(newUser).then(...);
about 4 years ago · Juan Pablo Isaza Denunciar

0

I've been doing the same project. It worked for me when I did:

npm install @azure/core-asynciterator-polyfill

Then added:

import '@azure/core-asynciterator-polyfill'; 

at the very top of my imports in the page I was working on.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda