Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

file locking causing problems using trunk #383

Open
akshatdevp opened this issue May 15, 2023 · 0 comments
Open

file locking causing problems using trunk #383

akshatdevp opened this issue May 15, 2023 · 0 comments

Comments

@akshatdevp
Copy link

akshatdevp commented May 15, 2023

When using trunk serve with neovim and rust tools, trunk is unable to access the dist folder for hot reloads. The error is that dist cannot be cleaned because access is denied. This doesn't happen when using just rust-analyzer.
OS : Windows 10

Steps to reproduce

rustup target add wasm32-unknown-unknown
cargo install --locked trunk

cargo.toml

[dependencies]
yew = { version = "0.20.0", features = ["csr"] }

src/main.rs

use yew::prelude::*;

#[function_component]
fn App() -> Html {
    let counter = use_state(|| 0);
    let onclick = {
        let counter = counter.clone();
        move |_| {
            let value = *counter + 1;
            counter.set(value);
        }
    };

    html! {
        <div>
            <button {onclick}>{ "+1" }</button>
            <p>{ *counter }</p>
        </div>
    }
}

fn main() {
    yew::Renderer::<App>::new().render();
}

index.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Yew App</title>
    </head>
</html>

trunk serve --open

The first run works, but if you make some changes it tries to modify the dist folder and fails.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant