parse-server
parse-server copied to clipboard
Parse server crash - Cannot read property 'encodeParseObjectInCloudFunction' of undefined
New Issue Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am not just asking a question.
- [x] I have searched through existing issues.
- [x] I can reproduce the issue with the latest version of Parse Server.
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
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.
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?
You could debug Parse Server to see where the error is happening exactly and what the values are that are causing this.
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: https://github.com/parse-community/parse-server/pull/8832
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.
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?
@dblythy Could you please check whether this issue is already fixed on alpha? If so, we can close this.
@mtrezza it seems that it was fixed here https://github.com/parse-community/parse-server/pull/8784. Could not replicate on alpha. @jaysonng can you send replication steps on Parse Server 7+?
Closing, as this has been fixed on alpha (Parse Server 8) and since it's not a security issue won't be backported to Parse Server 7 under our LTS policy. However, we'll be happy to review and merge a PR for Parse Server 7 if anyone wants to open one.