Join the Webstudio community

Updated 3 months ago

CLI Build - no HTML is Output

At a glance

The community member is trying to export their project for a static site, but is encountering issues. They tried using the cloud web interface, but got a "failed to download" error, so they tried using the CLI. The CLI build was successful, but no HTML files were output. The community member is unsure if they are missing something or if this is a bug.

In the comments, the community members discuss potential solutions, such as checking the dist/client folder, using npm build instead of the webstudio build command, and skipping pages that are causing build failures. They also discuss the differences between the webstudio build and npm build commands.

The community members were able to resolve the issue by checking the dist/client folder, but there is no explicitly marked answer in the comments.

Hi,

I want to export my project for a static site. When I use the cloud web interface I wait for it to complete, and then get some "failed to download" error, so I'm trying the CLI.

I've linked my project, gone into that directory, run npm install on the project (as I got a backtrace with missing packages if I didn't and just used the CLI), and then I can build successfully:
Plain Text
# webstudio build --template ssg
β”‚
β—‡  Scaffolding the project files
β”‚
β—‡  Downloaded fonts and images
β”‚
β—‡  Build finished


Except no HTML files are output. I assume the "public" folder is the intended destination. I see the assets containing images and CSS, but there are no pages in there.

Am I missing something here? Or is this bug?

Thanks
b
B
20 comments
Okay, maybe the issue is having build access to the project. If so, it'd be nice to get an error, and as I didn't need to click the three-dots menu to generate it, wasn't aware that this was a thing
No, that didn; do it
check dist/client
Where would that be?
I mean pnpm build and then check dist/client
or npm build in your case
Okay, that did it, thank you.
So should I even really be using the CLI tool, or is it better just to use node directly if it's really a project within that directorY?
Can I also build just one page, or ignore pages on others? I have some that are broken in the project but I'd stilllike to render the rest and come back to those later.
I guess that is probably why the initial export didn;t work
You can just delete those .html manually
You still need some static server to serve images and other assets
Sorry, should have clarified. It errors out so it doesn;t build. I get a 500 if I visit that page in the cloud. It's got some testing stuff in it so I'd rather not delete it, just ignore it
I meant in terms of building, am I bets just using npm directly over the webstudio CLI?
"webstudio build" generates code, "npm build" compiles this code into application or html/css/js
What build fails with?
Ah, okay. It'd be helpful if the docs could be updated to explain this.
Plain Text
Error: `NavigationMenuTrigger` must be used within `NavigationMenuItem`

Same as I get in the cloud
If there's a way I can just skip that page, that'd be ideal
I get the same now even when I've deleted that page. I can download from the cloud again but the local build fails with the same error message.
Add a reply
Sign up and join the conversation on Discord