4Twenty
4Twenty3w ago

Guys, I'm having an initialization error

Guys, I'm having an initialization error: convex 1.23.0 npm run dev
convex@0.1.0 predev convex dev --until-success && convex dev --once --run-sh 'node setup.mjs --once' && convex dashboard . . . error: unknown option '--once'' (Did you mean --once?)
11 Replies
erquhart
erquhart3w ago
Looks like your project's convex dependency is 0.1.0, which didn't have the --once flag
4Twenty
4TwentyOP3w ago
convex@0.1.0 is the name of the project. package.json
"name": "convex", "version": "0.1.0", "private": true, "scripts": { "dev": "npm-run-all --parallel dev:frontend dev:backend", "dev:frontend": "next dev", "dev:backend": "convex dev", "predev": "convex dev --until-success && convex dev --once --run-sh 'node setup.mjs --once' && convex dashboard", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@convex-dev/auth": "^0.0.81", "convex": "^1.23.0", "next": "15.2.3", "react": "^19.0.0", "react-dom": "^19.0.0"
erquhart
erquhart3w ago
ah! okay, can you run npm ls convex and share the output oh wait might that error be from passing the once flag to your setup.mjs?
4Twenty
4TwentyOP3w ago
I mean it comes from the initialization itself by default. This is the output without the flag.
convex@0.1.0 predev convex dev --until-success && convex dev --once --run-sh 'node setup.mjs' && convex dashboard ✔ Provisioned a dev deployment and saved its name as CONVEX_DEPLOYMENT to .env.local ✔ 10:35:51 Convex functions ready! (2.17s) error: too many arguments for 'dev'. Expected 0 arguments but got 1.
npm list convex convex@0.1.0 C:\Users\user\Desktop\convex ├─┬ @convex-dev/auth@0.0.81 │ └── convex@1.23.0 deduped └── convex@1.23.0
erquhart
erquhart3w ago
Can't find where the initialization would have produced this, was this created with npm create convex? If so can you share which framework you chose, auth, etc?
erquhart
erquhart3w ago
GitHub
template-react-vite-convexauth/package.json at main · get-convex/t...
Contribute to get-convex/template-react-vite-convexauth development by creating an account on GitHub.
erquhart
erquhart3w ago
Betting this is a cross platform issue where windows isn't handling the single quotes as expected there Can you try changing the single quotes around 'node setup.mjs --once' to escaped double quotes
\"node setup.mjs --once\"
\"node setup.mjs --once\"
okay actually there's another report that doesn't have that node setup command, it is indeed the once flag that's passed to convex: https://discord.com/channels/1019350475847499849/1359153953874382908/1359153953874382908 Let's move discussion there
4Twenty
4TwentyOP3w ago
This fixed the issue. Thanks a lot!
erquhart
erquhart3w ago
wait really? strange - but great! can you confirm whether you were using windows? oh i see it now, C:\
4Twenty
4TwentyOP3w ago
yeah, I'm using windows. Escaping double quotes fixed the command. "predev": "convex dev --until-success && convex dev --once --run-sh \"node setup.mjs --once\" && convex dashboard"
erquhart
erquhart3w ago
Good deal, just need to do that in all the templates then

Did you find this page helpful?