Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo leptos serve failes: Could not create "/pkg/pkg" #36

Closed
joepio opened this issue Dec 29, 2022 · 5 comments
Closed

cargo leptos serve failes: Could not create "/pkg/pkg" #36

joepio opened this issue Dec 29, 2022 · 5 comments

Comments

@joepio
Copy link

joepio commented Dec 29, 2022

  • cargo leptos new -g https://github.com/leptos-rs/start
  • cargo leptos watch
Cargo finished cargo build --package=leptos-start --bin=leptos-start --target-dir=target/server --no-default-features --features=ssr
Error: at `/Users/joep/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-leptos-0.1.0/src/command/serve.rs:8:42`

Caused by:
    0: Could not create "/pkg/pkg" at `/Users/joep/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-leptos-0.1.0/src/ext/fs.rs:58:10`
    1: Read-only file system (os error 30)
  • cargo-leptos 0.1.0
  • rustc 1.67.0-nightly (85f4f41de 2022-11-08)
  • MacOS 13.1, m1 pro
@gbj
Copy link
Contributor

gbj commented Dec 29, 2022

This may be due to my own misunderstanding... the template has, among its [package.metadata.leptos] settings, the following:

site-root = "/pkg"
site-pkg-dir = "pkg" 	

It's possible I'm misunderstanding these settings (I think I just borrowed them from Ben's examples) or that there's something wrong in my setup or in the integration.

@akesson
Copy link
Collaborator

akesson commented Dec 29, 2022

The site-root should be a relative path. It defaults to target/site in order to have all built artifacts in the same place, but if you want it outside of the target dir, then maybe just site?

@gbj
Copy link
Contributor

gbj commented Dec 29, 2022

Thanks — sounds like this is actually an issue with the new integration. I'll revert to using your Actix integration for now, and bring it up w/ Ben. Thanks.

@benwis
Copy link
Collaborator

benwis commented Jan 1, 2023

Yeah, that is not the right way to do things. Basically site-root should be server/target if you're using cargo-leptos and pkg if you're using wasm-pack. The latest PR for leptos supports that approach.

@gbj
Copy link
Contributor

gbj commented Jan 1, 2023

My bad! I'm going to migrate the leptos starter example today or tomorrow, so feel free to close this issue any time.

@akesson akesson closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants