Join the Webstudio community

Updated 5 months ago

Issues with CLI to Vercel

At a glance

The community member is having issues deploying their website to Vercel. They tried various commands, including webstudio sync, webstudio build --template=vercel, and vercel deploy --prod, but did not see any updates. They then tried to start from scratch by deleting the project locally and running webstudio-cli, but encountered an error related to a missing file.

Other community members provided suggestions, such as checking the webstudio-cli version and upgrading it to the latest version. They also discussed issues with using Node.js version 18 and the need to use version 20 instead. After some troubleshooting, the issue was resolved, and the community member confirmed that the fix worked.

Useful resources
I'm having some issues deploying my website to Vercel. Ran through the normal commands whenever I've updated my website and when I ran webstudio sync I didn't get a success message or error (the message is now lost into the ether, something with a URL in it). I then tried building npx webstudio build --template=vercel and then pushing to Vercel npx vercel deploy --prod but I never saw any updates.

So I decided to start from scratch. Delete my project locally.

npx webstudio-cli

but I get the following error

Plain Text
β—‡  The project is linked successfully
β”‚
β—‡  Where would you like to deploy your project?
β”‚  Vercel
β”‚
β—‡  Would you like to install dependencies? (recommended)
β”‚  Yes
β”‚
β—‡  Project data synchronized successfully
β”‚
β—‡  Scaffolding the project files
Error: ENOENT: no such file or directory, open 'app/route-templates/html.tsx'
    at async open (node:internal/fs/promises:641:25)
    at async readFile (node:internal/fs/promises:1254:14)
    at async createFramework (file:///Users/samuelgregory/.asdf/installs/nodejs/22.2.0/.npm/lib/node_modules/webstudio/lib/cli.js:455:24)
    at async prebuild (file:///Users/samuelgregory/.asdf/installs/nodejs/22.2.0/.npm/lib/node_modules/webstudio/lib/cli.js:716:17)
    at async build (file:///Users/samuelgregory/.asdf/installs/nodejs/22.2.0/.npm/lib/node_modules/webstudio/lib/cli.js:1160:3)
    at async Object.initFlow [as handler] (file:///Users/samuelgregory/.asdf/installs/nodejs/22.2.0/.npm/lib/node_modules/webstudio/lib/cli.js:1239:3) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'app/route-templates/html.tsx'
}
O
S
B
18 comments
Pinging the team internally
can you report the npx webstudio-cli --version ?
and while you are at it upgrade it to the latest version
Yeah, I'm trying to upgrade everything. Docs say node 18 which didn't work so now trying latest node
AFAIK npx always uses latest version?
Running npx webstudio-cli under node 18 brings up this error.

Plain Text
npx webstudio-cli
file:///Users/samuelgregory/.asdf/installs/nodejs/18.0.0/.npm/lib/node_modules/webstudio/lib/cli.js:90
  constants,
  ^^^^^^^^^
SyntaxError: The requested module 'node:fs/promises' does not provide an export named 'constants'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
    at async loadESM (node:internal/process/esm_loader:85:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)

Node.js v18.0.0
Currently trying to run under node v22.9.0 but same error as in the OP
Looking into the issue with node 20+
Node 18 will not work, that's expected
Great. Thank you. (docs say node 18 but I expected as much)
@TrySound https://docs.webstudio.is/university/self-hosting/cli
Can we make sure docs always show the same thing that we have configured?
this is going to be a problem all the time if we can't keep this synchronized
otherwise we need to make user install it in a way that always picks the right version
or avoid upgrading to newest versions so quickly without backwards compatibility
I think I already mentioned it. Recklessly updating all versions is not something you can do when you have production users.
We published the fix, please try 0.181.0 with node 20
Add a reply
Sign up and join the conversation on Discord