Skip to content

Unable to call Cloude code functions from web hook parse server 7.4.0 #9573

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
sessiontalk opened this issue Jan 27, 2025 · 7 comments
Closed
Labels
type:question Support or code-level question

Comments

@sessiontalk
Copy link

New Issue Checklist

Issue Description

TypeError: Cannot read properties of undefined (reading 'currentInstallationId')
at Object.request (c:\sessioncloud\node_modules\parse\lib\browser\RESTController.js:245:54)
at Object.run (c:\sessioncloud\node_modules\parse\lib\browser\Cloud.js:114:36)
at Object.run (c:\sessioncloud\node_modules\parse\lib\browser\Cloud.js:60:52)
at c:\sessioncloud\index.js:193:40
at Layer.handle [as handle_request] (c:\sessioncloud\node_modules\express\lib\router\layer.js:95:5)
at next (c:\sessioncloud\node_modules\express\lib\router\route.js:144:13)
at auth (c:\sessioncloud\index.js:99:12)
at Layer.handle [as handle_request] (c:\sessioncloud\node_modules\express\lib\router\layer.js:95:5)
at next (c:\sessioncloud\node_modules\express\lib\router\route.js:144:13)
at Route.dispatch (C:\sessioncloud\node_modules\express\lib\router\route.js:114:3) {stack: 'TypeError: Cannot read properties of undefine…de_modules\express\lib\router\route.js:114:3)', message: 'Cannot read properties of undefined (reading 'currentInstallationId')'}

Steps to reproduce

Call cloud code function from web hook

Actual Outcome

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

Expected Outcome

Cloud code function executes

Environment

Development

Server

  • Parse Server version: 7.4.0
  • Operating system: Windows 10
  • Local Host`

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: ``
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Node js

Logs

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.

@mtrezza
Copy link
Member

mtrezza commented Jan 28, 2025

Could you please provide an example code to reproduce this issue?

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Jan 28, 2025
@Jakub-Plan-d-k
Copy link

Jakub-Plan-d-k commented Apr 19, 2025

Hey, I had exactly the same log while setting up test environment locally. What solved it for me was that, on the top of the test setup, I had:
const Parse = require("parse/node");

When I removed it, all worked correctly.

I found this here:
#889 (comment)

@mtrezza
Copy link
Member

mtrezza commented Apr 19, 2025

@Jakub-Plan-d-k That comment you are referring to is correct. Why did you add it in the first place? Is there an example or docs where this is shown, so we can remove it?

@dplewis
Copy link
Member

dplewis commented Apr 19, 2025

@mtrezza looking at the OP you can see ‘lib/browser’ being used in the server so removing those imports should fix it. I think we can close this

@mtrezza mtrezza closed this as completed Apr 20, 2025
@mtrezza mtrezza added type:question Support or code-level question and removed type:bug Impaired feature or lacking behavior that is likely assumed labels Apr 20, 2025
@Jakub-Plan-d-k
Copy link

@mtrezza I had a local setup for some time now, but I have not found any references on how to setup the test environment. I referred to chatGPT to prepare me something to work with and step by step I figured it out from there successfully. The script it generated contained this line.
A documentation entry on how to set it up (or an example repo) would be very useful I believe. Took me like 30 commits to set up the github action script correctly.

@mtrezza
Copy link
Member

mtrezza commented Apr 23, 2025

@Jakub-Plan-d-k would our parse-server-example have helped?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

4 participants