Skip to content

Object.save() and Query.first() issues  #1601

Closed
@Kutikov

Description

@Kutikov

New Issue Checklist

Issue Description

I have a problem with saving and getting first object using Parse.Query in JS. The most strange thing is that in other my projects this code works seamlessly. I think that they are connected to each other, so I report about both of them in one time

  • await Parse.Query.first() is resulting in exception, while (await Parse.Query.find())[0] works correctly
  • Parse.Object.save() is resulting in undefined, not in issue

Steps to reproduce

Code to reproduce the new Parse.Query.first() problem:

const record = Parse.Object.extend('SyncVisitRecord'); //my class name string
const query = new Parse.Query(record);
query.equalTo("key", key);
const record1: Parse.Object = await query.first();

Code to reproduce the new Parse.Object.save() problem:

const record = Parse.Object.extend('SyncVisitRecord'); //my class name string
const query = new Parse.Query(record);
query.equalTo("key", key);
const record1: Parse.Object = await (await query.find())[0];
record1.set('lang', "us");
        record1.save()
            .then((gameScore) => {
                console.log(gameScore)
            }, (error) => {
                console.log(error)
            })

Actual Outcome

  • new Parse.Query.first() problem outcome is TypeError: Cannot read properties of undefined (reading 'className') at eval (parse.js:18430:39)
  • Parse.Object.save() problem outcome is undefined

Expected Outcome

  • I wait for regular Parse.Object
  • I wait for the saved object in db and regular Parse.Object in console

Environment

Server

  • Parse Server version: ^5.2.1
  • Operating system: Ubuntu 22.04.1 LTS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Oracle Cloud

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: ^5.0.9
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Client

  • Parse JS SDK version: ^3.5.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-alphaReleased as alpha versionstate:released-betaReleased as beta versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions