Join the Webstudio community

Updated 6 days ago

Error using CLI to deploy netlify SSG

This convo has been continued at https://discord.com/channels/955905230107738152/1314298767536685077

I get an error when using the CLI to build and deploy a static site for netlify

Here's what I did: (>> indicates a command is run
>>webstudio
selected the option to make a new folder for the project
pasted share link
selected netlify ssg from template options
selected to install recommended dependencies
L
B
15 comments
Note: if I go through the steps do deploy a dynamic site it works. If I then run the webstudio command a second time to sync and deploy as a ssg it does work. It only seems to give the error if I select ssg on the first go
Have you try to run npm install?
wdym? I've used that to install webstudio and succesfully used the CLI several times
I think the answer is yes but idk exactly what you're referring to
I mean take a look at package.json in project root. Does it contain "@webstudio-is/image"?
"@webstudio-is/image": "0.189.0",
So the package is there. Just not installed.
Ok so after running npm install it did seem to work. Why is that necessary for the ssg build though? I've never run into that issue with the netlify functions (dynamic)
Also it asked: Please provide a publish directory (e.g. "public" or "dist" or "."):
I assume . for the root directory? (I used cd to go to the project folder after it was created)
Well everything in the terminal seemed to work. The website on netlify doesn't work at all. back to the docs
Ok I figured out to do dist/client cause that's where the files are.
Definitely something that should be touched on in the docs

Speaking of which, where's the best place to suggest something for the docs? #︳suggestions or something on github?
Good catch @Luke Monroe !
You can click "edit on github" on any page in docs
https://docs.webstudio.is
Attachment
image.png
Thanks. I might sometimes want to offer a general suggestion rather than write myself but I'll definitely give that a go
So I'm going to bring this up again...it seems that when deploying a static site, I consistently run into the issue where it's necessary to run npm install before building and deploying. Is this a bug or a reality of the CLI that should be written in the docs?
Add a reply
Sign up and join the conversation on Discord