parse-community / parse-server-example

Example of Parse Server using the express framework.
http://parseplatform.org
1.89k stars 5.43k forks source link

Start error #508

Closed boberski666 closed 2 months ago

boberski666 commented 2 months ago

I just download newest packeage for server and try to run it. After I type npm run I get:

[root@servx parse]# npm start

> parse-server-example@2.0.0 start
> node index.js

file:///home/parse/index.js:43
const parse = new ParseServer(api);
              ^

TypeError: ParseServer is not a constructor
    at file:///home/parse/index.js:43:15
    at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v22.8.0

my modified code of index.js is:

import http from 'http';
import express from 'express';

import ParseServer from 'parse-server';
import ParseDashboard from 'parse-dashboard';

import path from 'path';
const __dirname = path.resolve();

export const api = {
    //config
};

var dashboard = new ParseDashboard({
    //config
});

export const app = express();
app.set('trust proxy', true);

const parse = new ParseServer(api);
await parse.start();

app.use('/gildia', parse.app);
app.use('/', dashboard);

const httpServer = http.createServer(app);
httpServer.listen(1337, function() {
    console.log('Parse running on port 1337.');
});
[root@servx parse]# cat /etc/os-release
NAME="AlmaLinux"
VERSION="8.10 (Cerulean Leopard)"

any tips what I am doing wrong?

parse-github-assistant[bot] commented 2 months ago

Thanks for opening this issue!

mtrezza commented 2 months ago

Please comment if it has been confirmed to be a bug and we can re-open this issue.