trunk-rs / trunk

Build, bundle & ship your Rust WASM application to the web.

Home Page:https://trunkrs.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

output filename collision

Its-Just-Nans opened this issue Β· comments

commented

Hello,

I have some trouble using trunk serve

2024-03-13T14:20:05.638423Z  INFO πŸš€ Starting trunk 0.19.1
2024-03-13T14:20:06.289681Z  INFO πŸ“¦ starting build
warning: output filename collision.
The bin target `my_project` in package `my_project v0.1.0 (/home/n4n5/Documents/github/proj311-test)` has the same output filename as the lib target `my_project` in package `my_project v0.1.0 (/home/n4n5/Documents/github/proj311-test)`.
Colliding filename is: /home/n4n5/Documents/github/proj311-test/target/wasm32-unknown-unknown/debug/my_project.wasm
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
warning: output filename collision.
The bin target `my_project` in package `my_project v0.1.0 (/home/n4n5/Documents/github/proj311-test)` has the same output filename as the lib target `my_project` in package `my_project v0.1.0 (/home/n4n5/Documents/github/proj311-test)`.
Colliding filename is: /home/n4n5/Documents/github/proj311-test/target/wasm32-unknown-unknown/debug/my_project.wasm.dwp
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s
2024-03-13T14:20:07.474165Z ERROR ❌ error
error from build pipeline

Caused by:
    0: HTML build pipeline failed (1 errors), showing first
    1: error from asset pipeline
    2: running cargo build
    3: found more than one target artifact: ["my_project", "my_project"]:
        * consider adding `<link data-trunk rel="rust" data-bin={bin} />` to the index.html to build only the specified binary
        * or adding `<link data-trunk rel="rust" data-target-name={artifact} />` to select the specific artifact by name
2024-03-13T14:20:07.474228Z  INFO πŸ“‘ serving static assets at -> /
2024-03-13T14:20:07.474661Z  INFO πŸ“‘ server listening at:
2024-03-13T14:20:07.474667Z  INFO     🏠 http://127.0.0.1:8080/
2024-03-13T14:20:07.474672Z  INFO     🏠 http://[::1]:8080/

Do you have any idea where the problem could come from?

Thanks

commented

Update :

The problem is from

[lib]
crate-type = ["cdylib", "rlib"]

when removed it's works

That's more of a cargo problem then, right?

commented

I think yes, closing it !

Thanks for trunk