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

Unable to start Parse Server 7.4.0 in VS Code Debug Mode: Push Adapter fails with "Adapter prototype don't match expected prototype" #9517

Open
pocketcolin opened this issue Jan 8, 2025 · 5 comments · May be fixed by #9524
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@pocketcolin
Copy link

pocketcolin commented Jan 8, 2025

New Issue Checklist

Issue Description

After upgrading my server to Parse Server 7.4.0, I discovered that I no longer can start the server with VS Code's debugger. You can actually fix this issue by fully disabling the push worker and adding the following to your Parse config:

push: {
    queueOptions: {
        disablePushWorker: true
    }
},

Steps to reproduce

  1. Run Parse Server 7.4.0 (I use it with Express but I'm guessing that's not relevant here) in debug mode in VS Code. My debug config is as follows:
{
    "name": "Debug Server",
    "type": "node",
    "request": "launch",
    "preLaunchTask": "npm: build",
    "program": "${workspaceFolder}/dist/index.js",
    "outFiles": ["${workspaceFolder}/dist/**/*.js"],
    "autoAttachChildProcesses": true,
    "console": "internalConsole"
}

Actual Outcome

In my console, I get the following error:

Error: Adapter prototype don't match expected prototype
    at AdaptableController.validateAdapter (/Users/pocketcolin/server/node_modules/parse-server/lib/Controllers/AdaptableController.js:66:13)
    at new PushWorker (/Users/pocketcolin/server/node_modules/parse-server/lib/Push/PushWorker.js:32:34)
    at Object.getPushController (/Users/pocketcolin/server/node_modules/parse-server/lib/Controllers/index.js:210:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async ParseServer.start (/Users/pocketcolin/server/node_modules/parse-server/lib/ParseServer.js:174:30)
    at async start (/Users/pocketcolin/server/dist/index.js:239:5)
    at async throng (/Users/pocketcolin/server/node_modules/throng/lib/throng.js:24:12)

Expected Outcome

Parse Server starts up normally.

Environment

"node": "20.17.0",
"npm": "10.8.2"
"express": "4.21.0",
"parse-server": "7.4.0"

Server

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

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: n/a
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Mongodb

Logs

Copy link

parse-github-assistant bot commented Jan 8, 2025

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.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Jan 8, 2025
@3011felix
Copy link

I also noticed this error on versions < 7.4.0.
I think it's happening since nodejs > 22.11.0

@vctechplus
Copy link

vctechplus commented Jan 9, 2025

Have the same issue, but no crash with node 20.x

@mtrezza
Copy link
Member

mtrezza commented Jan 9, 2025

Thanks for reporting, we're actively looking into this issue.

@dblythy dblythy linked a pull request Jan 10, 2025 that will close this issue
@pocketcolin
Copy link
Author

pocketcolin commented Jan 10, 2025

@3011felix yep agreed on it happening with node > 22.11. I think VS Code debug mode was running a different version of node unbeknownst to me. The PR @dblythy made (#9524) fixes this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants