parse-community / parse-community/parse-server

Cannot specify cloud file string using ES Module

Open
#7,559 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

New Issue Checklist
Issue Description

When using Parse Server with "type": "module", it is not possible to set a cloud string, as it returns Must use import to load ES Module.

Steps to reproduce

Create a Parse Server with "type": "module" (such as https://github.com/parse-community/parse-server-example/pull/400), set cloud file string

Actual Outcome

Error: Must use import to load ES Module: /Users/daniel/GitHub/parse-server-example/cloud/main.js require() of ES modules is not supported.

Expected Outcome

Cloud function to work

Workaround

() => import('./cloud/main.js'),

Environment

Server

  • Parse Server version: 4.10.3
  • Operating system: MacOS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Localhost

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

Reproduce the issue with Parse Server configured as an ES module and a cloud file at cloud/main.js, starting with the cloud file string loading path. Compare the failing require() behavior with the documented dynamic-import workaround; done means the cloud function loads and works without that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
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.