Skip to content
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

Parse server crash - Cannot read property 'encodeParseObjectInCloudFunction' of undefined #8783

Open
4 tasks done
zivchen opened this issue Oct 22, 2023 · 6 comments · Fixed by #8784
Open
4 tasks done
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@zivchen
Copy link
Contributor

zivchen commented Oct 22, 2023

New Issue Checklist

Issue Description

Parse server crash - Cannot read property 'encodeParseObjectInCloudFunction' of undefined

Steps to reproduce

I cannot send you my network body its too complex to explain, but its easy to see in the code

Actual Outcome

Parse server crash - Cannot read property 'encodeParseObjectInCloudFunction' of undefined

Expected Outcome

Not to crash

Environment

Prase server 6.3.1

FunctionsRouter.js - line 15 does not pass the config object to the parseObject function
That will crash FunctionsRouter.js - line 21 config.encodeParseObjectInCloudFunction because the config is undefined in this case

Please pass config object in line 15 and maybe add config?.encodeParseObjectInCloudFunction

Thanks

@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 22, 2023

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.

@jaysonng
Copy link

jaysonng commented Mar 12, 2024

this thread is the only thread I can find that mentions encodeParseObjectInCloudFunction

I am encountering this error

TypeError: Cannot read properties of undefined (reading 'encodeParseObjectInCloudFunction')
    at parseObject (<project path>/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:26:55)
    at <project path>/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:20:14
    at Array.map (<anonymous>)
    at parseObject (<project path>/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:19:16)
    at <project path>/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:39:52
    at <project path>/parse-server/node_modules/lodash/lodash.js:13469:38
    at <project path>/parse-server/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (<project path>/parse-server/node_modules/lodash/lodash.js:3032:24)
    at Function.mapValues (<project path>/parse-server/node_modules/lodash/lodash.js:13468:7)
    at parseParams (<project path>/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:39:26)

when I try to pass and array of ParseObjects as a property for CloudCode (i.e. [Object])

As you can see on the 1st line of the error,

TypeError: Cannot read properties of undefined (reading 'encodeParseObjectInCloudFunction')

It's trying to read encodeParseObjectInCloudFunction from config from FunctionsRouter.js if I understand it correctly.

However, even when I do place encodeParseObjectInCloudFunction: true in my config and as I understand it, it's already set to true by default.

What else can I look at to fix this problem?

@mtrezza mtrezza reopened this Mar 12, 2024
@mtrezza
Copy link
Member

mtrezza commented Mar 12, 2024

You could debug Parse Server to see where the error is happening exactly and what the values are that are causing this.

@jaysonng
Copy link

jaysonng commented Mar 13, 2024

ah. I just saw that the fix for this issue is in Parse-Server 7.0 based on the linked discussion.

So does that mean this fix won't be in 6.x release?

this fix in particular:
#8832

@mtrezza
Copy link
Member

mtrezza commented Mar 13, 2024

No, we won't back port it to PS6, since it's not a security issue. We are happy to review it if you would like to open a PR though.

@jaysonng
Copy link

No, we won't back port it to PS6, since it's not a security issue. We are happy to review it if you would like to open a PR though.

so when I try to do a PR to alpha branch, since the changes I'm making are already there, nothing really is getting pulled. What branch should I make a PR on and what branch should I base my new branch from?

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
3 participants