Code Monkey home page Code Monkey logo

Comments (4)

NiklasEi avatar NiklasEi commented on July 29, 2024 2

I expect serve to also build. Other tools do the same. trunk serve or cargo run also compile first if the project isn't compiled yet.

Running build before serve could be a work-around, yes.

from cargo-leptos.

benwis avatar benwis commented on July 29, 2024

from cargo-leptos.

NiklasEi avatar NiklasEi commented on July 29, 2024

The serve command actually does exactly what I need for static site generation. The name might not really fit, but the functionality is correct. It compiles the bin for the native target and the frontend for WASM. Then it runs the binary. For a SSR app the binary will start the actix/axum server. In the case of SSG, it will generate the html files of static routes.

This issue is really only about the return code of the command. Even if you use cargo leptos serve for a "normal" SSR app, and one of the two compilations fail, the command will return 0 instead of some error code.

from cargo-leptos.

benwis avatar benwis commented on July 29, 2024

I should say that serve building the package is at best an oversight and at worst a bug, as serve really is only supposed to serve an existing binary. Is it possible to solve your use case by running build first to catch compilation errors, and then serve? Or is there another level of runtime errors you're hoping to catch around generation?

from cargo-leptos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.