Skip to content

Parse.Query.first() not working after [email protected] #1592

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
dipendras opened this issue Nov 2, 2022 · 11 comments · Fixed by #1600
Closed
4 tasks done

Parse.Query.first() not working after [email protected] #1592

dipendras opened this issue Nov 2, 2022 · 11 comments · Fixed by #1600
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@dipendras
Copy link

dipendras commented Nov 2, 2022

New Issue Checklist

Issue Description

Parse.Query.first() is not working after [email protected]

Steps to reproduce

let Product = Parse.Object.extend('Product');
const query = new Parse.Query(Product);
let result = await query.first();

NB: Product is a name of a class.

Actual Outcome

throws error
error.code: undefined
error.message: Cannot read properties of undefined (reading 'className')

Expected Outcome

object of 'Product' class

Environment

Using Parse JS SDK:

Server

  • Parse Server version: 4.5.0
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Back4app

Client

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 2, 2022

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.

@mtrezza
Copy link
Member

mtrezza commented Nov 2, 2022

Could you please fill out the issue template? It contains a section for a code example and asks other info which helps others to investigate this issue.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Nov 2, 2022
@mtrezza
Copy link
Member

mtrezza commented Nov 2, 2022

I can reproduce the issue with the version 4.5.0 of Parse Server

Can you reproduce this issue with the latest alpha version of Parse Server 5?

@mtrezza
Copy link
Member

mtrezza commented Nov 4, 2022

See #1593 (comment)

@dblythy
Copy link
Member

dblythy commented Nov 7, 2022

I can replicate this issue.

  1. run npm run build
  2. Create a unit test:
fit('can load server', (done) => {
    new Parse.Object('TestObject').save()
});
  1. Create this file in /dist:
<!DOCTYPE html>
<html>
<head>
  <meta charset='utf-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <title>Parse Functionality Test</title>
  <script src='parse.js'></script>
</head>
<body>
  <div>
    Parse Login
  </div>
  <script>
    (async function() {
      Parse.initialize('integration');
      Parse.serverURL = 'http://localhost:1337/parse';
      const obj = await new Parse.Query('TestObject').first();
      alert(obj.id)
    })();
  </script>
</body>
</html>
  1. Run npm run integration (so a mock Parse Server is running)
  2. Open the HTML file in the browser.

With the distributed code as of 3.5.0, there are errors.

It seems that this issue, #1599, #1596, #1593 are all symptoms of the same problem.

In my testing, the code breaks at 3.5.0-alpha.4. I'm assuming #1553 is the commit that caused this issue, some babel or gulp dependancy is broken off. I'll continue to investigate.

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 3.5.1-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Nov 7, 2022
@mtrezza
Copy link
Member

mtrezza commented Nov 7, 2022

Closing via #1600

@mtrezza mtrezza closed this as completed Nov 7, 2022
@mtrezza
Copy link
Member

mtrezza commented Nov 7, 2022

This should be fixed with https://github.com/parse-community/Parse-SDK-JS/releases/tag/3.5.1-alpha.2, could you try it out and let us know?

@dipendras
Copy link
Author

I confirm that the issue is fixed with [email protected].

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 3.5.1-beta.2

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 26, 2022
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 3.5.1

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants