parse-community / parse-community/parse-server

TypeScript: "Cannot find name 'Parse'" when using Parse.Cloud in cloud code

Open
#9,892 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

TypeScript does not recognize the global Parse object in cloud code, resulting in the error:
Cannot find name 'Parse' when referencing Parse.Cloud. This happens even after installing the parse package and using the recommended import patterns. The Parse object is available at runtime, but TypeScript does not recognize it, making it difficult to write type-safe cloud code.

Steps to reproduce
  1. Clone the repo: https://github.com/tiavina-mika/parse-server-8-ts-issue
  2. Run npm install
  3. Open src/cloud/main.ts in VS Code.
  4. You will see a TypeScript error on any usage of Parse (e.g., Parse.Cloud.beforeSave).
Actual Outcome

TypeScript compilation fails with:
Cannot find name 'Parse'

Expected Outcome

TypeScript should recognize the global Parse object and allow type-safe cloud code development.

Environment

Server

  • Parse Server version: 8.2.5
  • Operating system: Windows
  • Local or remote host: Local

Database

  • System: MongoDB
  • Database version: v4.0.6
  • Local or remote host: local
Logs

cloud/main.ts:XX:XX - error TS2304: Cannot find name 'Parse'.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Clone the linked reproduction repository, run npm install, and inspect src/cloud/main.ts in VS Code to reproduce the TS2304 error on Parse.Cloud usage. Trace how the parse package and cloud-code typings are loaded; done means TypeScript recognizes the global Parse object and allows type-safe cloud code without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.