parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Cannot use import statement outside a module

Open kumardennis opened this issue 3 years ago • 3 comments
trafficstars

New Issue Checklist

Issue Description

When running cmd : parse-server --appId APPLICATION_ID --clientKey CLIENT_KEY --masterKey MASTER_KEY --databaseURI mongodb://localhost/test I get error as mentioned in the title

Steps to reproduce

Run parse-server --appId APPLICATION_ID --clientKey CLIENT_KEY --masterKey MASTER_KEY --databaseURI mongodb://localhost/test and use es6(import/export)

Actual Outcome

Getting error `import { CreateUserRequestModel } from "models/users/UserModels"; ^^^^^^

SyntaxError: Cannot use import statement outside a module at compileFunction () at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1033:15) at Module._compile (node:internal/modules/cjs/loader:1069:27) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18)`

Expected Outcome

Should compile

Environment

4.5.0

Server

  • Parse Server version: 4.5.0
  • Operating system: windows 11
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local cloud-code

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.8.1
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local mongodb-runner

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): javascript
  • SDK version: 2.2.5

Logs

warn: DeprecationWarning: The Parse Server option 'directAccess' default will change to 'true' in a future version. Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one. warn: DeprecationWarning: The Parse Server option 'enforcePrivateUsers' default will change to 'true' in a future version. C:\source\teach_and_learn_teacher\Teach_And_Learn_B4A_Cloud_Code\cloud\controllers\teachersControllers\createUserTeacher.ts:1 import { CreateUserRequestModel } from "models/users/UserModels"; ^^^^^^

SyntaxError: Cannot use import statement outside a module at compileFunction () at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1033:15) at Module._compile (node:internal/modules/cjs/loader:1069:27) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\source\teach_and_learn_teacher\Teach_And_Learn_B4A_Cloud_Code\cloud\main.ts:2:1)

kumardennis avatar Oct 10 '22 19:10 kumardennis

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: nachocodoner
:x: step-security-bot
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Oct 04 '24 12:10 CLAassistant

Deploy Preview for v3-migration-docs canceled.

Name Link
Latest commit ac963a9929a9b32515c60384f160ab8b8d900bc7
Latest deploy log https://app.netlify.com/sites/v3-migration-docs/deploys/670529dc20000f0008159285

netlify[bot] avatar Oct 04 '24 12:10 netlify[bot]

Deploy Preview for v3-meteor-api-docs canceled.

Name Link
Latest commit ac963a9929a9b32515c60384f160ab8b8d900bc7
Latest deploy log https://app.netlify.com/sites/v3-meteor-api-docs/deploys/670529dcb692ad0008ad2614

netlify[bot] avatar Oct 04 '24 12:10 netlify[bot]

@nachocodoner any update on merging this?

StorytellerCZ avatar Feb 16 '25 10:02 StorytellerCZ