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
Looks like your project's convex dependency is 0.1.0, which didn't have the --once flag
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"
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?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
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?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.
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
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
This fixed the issue.
Thanks a lot!
wait really?
strange - but great!
can you confirm whether you were using windows?
oh i see it now, C:\
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"
Good deal, just need to do that in all the templates then