Unable to setup p5js web editor locally

When I run npm start in my p5js-web-editor repo. I get this error:

/Users/faisal_imtiyaz/Desktop/openSource/p5.js-web-editor/server/server.js:44
var MongoStore = (0, _connectMongo["default"])(_expressSession["default"]);
                                              ^

TypeError: Class constructor MongoStore cannot be invoked without 'new'
    at Object.<anonymous> (/Users/faisal_imtiyaz/Desktop/openSource/p5.js-web-editor/server/server.js:35:32)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Module._compile (/Users/faisal_imtiyaz/Desktop/openSource/p5.js-web-editor/node_modules/pirates/lib/index.js:117:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Object.newLoader [as .js] (/Users/faisal_imtiyaz/Desktop/openSource/p5.js-web-editor/node_modules/pirates/lib/index.js:121:7)
    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.<anonymous> (/Users/faisal_imtiyaz/Desktop/openSource/p5.js-web-editor/index.js:18:3)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47
[nodemon] app crashed - waiting for file changes before starting...

node-version :16.14.2

Hi @faisu

If you haven’t already, I’d recommend reading the development installation instructions here.

Make sure you are using the correct version of Node and that MongoDB is installed and running.

cc @raclim

@sableRaph Thanks for taking time to reply. I did the docker development setup and encountered the same error

Someone on the p5.js discord said

Upgrade MongoDB Driver Dependencies by raclim · Pull Request #3187 · processing/p5.js-web-editor · GitHub - mongodb dependencies were updated yesterday; unsure if related

You could also try asking on the repository.

1 Like

Thanks for raising this @faisu After looking into this, I realized that there were some issues with our Docker configuration!

I personally don’t use Docker as often so I didn’t realize some of it had fallen out of date—I’m sorry about that! However, I wasn’t able to encounter this particular issue that you’re experiencing. I think this might come up if you newer versions of mongoose or connect-mongo installed. I did upgrade them near the end of last week, but it seems like this issue had been occurring before these upgrades were merged, so I’m not entirely sure what might be happening there :thinking:

I just upgraded the Docker configuration, which also updates the mongo version. Maybe you could try reinstalling it with these updates?

1 Like

Thankyou @raclim for taking time to reply. Will sure try what you suggest.