trunk
trunk copied to clipboard
error getting canonical path in Windows when Trunk.toml file has target "static/index.html"
When using trunk on Windows, and the config file Trunk.toml has a path that uses forward slashes /.
[build] target = "static/index.html" release = false dist = "dist" manifest = "Cargo.toml" public_url = "/
It fails with: Error: error getting canonical path to source HTML file "\\?\C:\Users\\Projects\\**-web-app\static/index.html"
Hey @kotshie. Sounds like the quick and dirty fix is to just use a Windows style path in your config file. That should resolve the issue. Given that the Trunk.toml is fully controlled by the end user (you), is there any reason why that will not work here?
Hey @kotshie. Sounds like the quick and dirty fix is to just use a Windows style path in your config file. That should resolve the issue. Given that the Trunk.toml is fully controlled by the end user (you), is there any reason why that will not work here?
It's annoying when the code expects developers across different operating systems, which is often the case in the open-source world. I and my coworkers bumped into this problem earlier and our solutions is to have Trunk.toml and Trunk-win.toml, with windows users running trunk --config Trunk-win.toml. This is not very convenient and requires duplicating parts of the config.
I suggest we make it consistent with how Rust's std::path handles paths: "/" on unix, "/" OR "\" on Windows, see https://doc.rust-lang.org/std/path/struct.Path.html
We won't need to change any documentation and this won't even be a breaking change but an extra feature.
I suggest we make it consistent with how Rust's
std::pathhandles paths: "/" on unix, "/" OR "" on Windows, see https://doc.rust-lang.org/std/path/struct.Path.html We won't need to change any documentation and this won't even be a breaking change but an extra feature.
I did some extensive testing and it turns out this is already the behavior on the master branch 🤦 , just not on the changelog.
So to use the new behavior, you can just install the master branch with cargo install --git https://github.com/thedodd/trunk trunk
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.