DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.33k stars 736 forks source link

Dioxus fullstack empty project without tailwind depends on non-existent input.css #2192

Open Silvea12 opened 3 months ago

Silvea12 commented 3 months ago

Problem

When creating a new dioxus fullstack project, the build will fail due to a missing input.css - something that is supplied with the tailwind css template. There is no reference to it in any files, and it's not a requirement of the web template.

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

The build is successful - there is nothing depending on the input.css file at the project root.

Resulting behavior

ERROR manganis_cli_support::manifest: Failed to copy static asset: Failed to read file from location: /-snip-/dx-fullstack-test/input.css
Error: 🚫 Building project failed:

Caused by:
    0: Failed to read file from location: /-snip-/dx-fullstack-test/input.css
    1: No such file or directory (os error 2)

Screenshots

N/A

Environment:

Questionnaire

Ame1ma commented 3 months ago

I encountered the same problem. I removed the ~/.cargo/assets path and it works.

Silvea12 commented 3 months ago

... Why in the world does dioxus write to ~/.cargo? Seems to fix it but why would it write there? That in of itself feels like a bug.

Silvea12 commented 3 months ago

Ah, I've found it. As per https://github.com/DioxusLabs/collect-assets/blob/c585779eaf615900f1a76f332905988da3922573/common/src/cache.rs#L11-L14 it uses home::cargo_home() as a base - and this defaults to ~/.cargo if unspecified.

I'm not sure I'd consider this good behavior - I feel like it should make something in the project root directory instead.

ealmloff commented 2 months ago

You might be running into https://github.com/DioxusLabs/collect-assets/issues/14. If you used a css file in the past with manganis and removed it, there is a bug that will cause it to not be removed.

We use a global directory instead of a directory in the project so that assets for a library are bundled into any crates that rely on that library