Skip to content

undefined this when running ParseQuery with .first #1613

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

Closed
4 tasks done
ranby opened this issue Nov 18, 2022 · 4 comments
Closed
4 tasks done

undefined this when running ParseQuery with .first #1613

ranby opened this issue Nov 18, 2022 · 4 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@ranby
Copy link

ranby commented Nov 18, 2022

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)
@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@dblythy
Copy link
Member

dblythy commented Nov 18, 2022

3.5.0 is broken, please see #1600.

Can you try 3.5.1-alpha.2 or revert to 3.4.4

@ranby
Copy link
Author

ranby commented Nov 18, 2022

Aaah thank you @dblythy! 3.5.1-alpha.2 works!

I would have saved a lot of time if I just had looked through closed issues as well 😅

@dblythy
Copy link
Member

dblythy commented Nov 18, 2022

Closing as fixed via #1600

@dblythy dblythy closed this as completed Nov 18, 2022
@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants