Skip to content

undefined this when running ParseQuery with .first #1613

Closed
@ranby

Description

@ranby

New Issue Checklist

Issue Description

When running a Parse.Query with .first(), I get an error like TypeError: Cannot read properties of undefined (reading 'className') at eval (ParseQuery.js:1523:39)

Parse.Query with .find works fine.
This seem to have broke in v3.5.0. Earlier versions work fine for me.

After digging into the source code a bit it looks like this in ParseQuery.js gets modified to undefined after QueryController has ran the async query request.

Steps to reproduce

Run a query like

const result = await new Parse.Query('Item').equalTo('objectId', '1234567890').first()
console.log({ result })

Actual Outcome

A runtime error is thrown (see Logs section)

Expected Outcome

Expected result would be an Parse.Object with the specified objectId or undefined

Environment

Client

  • Parse JS SDK version: 3.5.0

Logs

Complete error:

TypeError: Cannot read properties of undefined (reading 'className')
    at eval (ParseQuery.js:1523:39)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: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