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

Cannot specify cloud file string using ES Module #7559

Open
4 tasks done
dblythy opened this issue Sep 9, 2021 · 5 comments
Open
4 tasks done

Cannot specify cloud file string using ES Module #7559

dblythy opened this issue Sep 9, 2021 · 5 comments
Labels
bounty:$5 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@dblythy
Copy link
Member

dblythy commented Sep 9, 2021

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 parse-community/parse-server-example#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
@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 9, 2021

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.

@dblythy dblythy added the type:bug Impaired feature or lacking behavior that is likely assumed label Sep 9, 2021
@mtrezza
Copy link
Member

mtrezza commented Sep 14, 2021

Closed via #7560

@mtrezza mtrezza closed this as completed Sep 14, 2021
@dblythy dblythy reopened this Jan 28, 2022
@mtrezza
Copy link
Member

mtrezza commented Nov 12, 2023

@Moumouls Can we merge #7560 again? Your comment led to a revert, but since Parse Server 6 supports an async start, the issue your mentioned should be solved and we can merge this, right?

There is also #7914 and #8232, but I believe that the issue here hasn't been addressed in these. If so, then we'd just have to reopen #7560 and merge, maybe with some slight modifications.

@dblythy dblythy closed this as completed Nov 15, 2023
@mtrezza
Copy link
Member

mtrezza commented Nov 15, 2023

@dblythy Is this issue already resolved?

@mtrezza mtrezza reopened this Nov 17, 2023
@mtrezza
Copy link
Member

mtrezza commented Nov 17, 2023

I was able to reproduce the issue with Parse Server 6.5.0-beta.1 where setting a ESM for the cloud property of Parse Server throws the error:

Error [ERR_REQUIRE_ESM]: require() of ES Module main.js from node_modules/parse-server/lib/ParseServer.js not supported.
Instead change the require of main.js in node_modules/parse-server/lib/ParseServer.js to a dynamic import() which is available in all CommonJS modules.

Issue reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$5 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants