dioxus
dioxus copied to clipboard
Failed to copying tailwind.css
Problem
- Some tailwind.css produced by tailwind-cli cause panic copying asset. tailwind.zip
Steps To Reproduce
Steps to reproduce the behavior:
- Copy the tailwind.css to
assetsdirectory - import css file with
asset!macro dx serve
Expected behavior
- It did work for 0.6.0-alpha.5
Screenshots
Environment:
- Dioxus version: 0.6.0-rc.0
- Rust version: rustc 1.82.0 (f6e511eec 2024-10-15)
- OS info: Linux hackartist-archlinux 6.12.1-arch1-1 1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024 16:04:27 +0000 x86_64 GNU/Linux
- App platform: web, fullstack
Questionnaire
I hit the same issue
Environment:
Dioxus version: 0.6.0 Rust version: rustc 1.83.0 (90b35a623 2024-11-26) OS info: Windows 11 App platform: web, fullstack
I hit the same issue when upgrading from Dioxus CLI 0.5 to 0.6 - turns out the assets/main.css that used to get generated is not... compatible with modern minification? Maybe the old css is bad but it was a serious pain to figure out the root cause - could the error reporting be improved to the point that enabling and understanding stacks isn't needed?
user@machine:~/Desktop/data/work/projects$ dx new assetbug
โ ๐คท Which sub-template should be expanded? ยท Bare-Bones
โ ๐คท Do you want to use Dioxus Fullstack? ยท false
โ ๐คท Do you want to use Dioxus Router? ยท false
โ ๐คท Do you want to use Tailwind CSS? ยท false
โ ๐คท Which platform do you want DX to serve by default? ยท Web
8.170s INFO Generated project at /home/user/Desktop/data/work/projects/assetbug
`cd` to your project and run `dx serve` to start developing.
If using Tailwind, make sure to run the Tailwind CLI.
More information is available in the generated `README.md`.
Build cool things! โ๏ธ
user@machine:~/Desktop/data/work/projects$ cp oldproject/assets/main.css assetbug/assets/
user@machine:~/Desktop/data/work/projects$ cd assetbug/
user@machine:~/Desktop/data/work/projects/assetbug$ RUST_BACKTRACE=1 dx serve
20:51:01 [dev] ----------------------------------------------------------------- Serving your Dioxus app: assetbug ๐
โข Press `ctrl+c` to exit the server
โข Press `r` to rebuild the app
โข Press `o` to open the app
โข Press `v` to toggle verbose logging
โข Press `/` for more commands and shortcuts
Learn more at https://dioxuslabs.com/learn/0.6/getting_started
----------------------------------------------------------------
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ /:more โฎ
โ App: โโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ 27.4s Platform: Web โ
โ Bundle: โโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ 3.5s App features: ["web"] โ
โ Status: Copying asset 6/6 favicon.icothread '<unnamed>' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-cli-opt-0.6.1/src/css.rs:37:75:
called `Result::unwrap()` on an `Err` value: Error { kind: UnexpectedToken(Semicolon), loc: Some(ErrorLocation { filename: "", line: 1, column: 31 }) }
stack backtrace: header.svg 0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: dioxus_cli_opt::css::minify_css
4: dioxus_cli_opt::css::process_css
5: dioxus_cli_opt::file::process_file_to
6: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
7: rayon::iter::plumbing::Folder::consume_iter
8: rayon::iter::plumbing::bridge_producer_consumer::helper
9: rayon_core::join::join_context::{{closure}}
10: rayon::iter::plumbing::bridge_producer_consumer::helper
11: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute
12: rayon_core::registry::WorkerThread::wai6note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread '<unnamed>' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-cli-opt-0.6.1/src/css.rs:37:75:
called `Result::unwrap()` on an `Err` value: Error { kind: UnexpectedToken(Semicolon), loc: Some(ErrorLocation { filename: "", line: 1, column: 31 }) }
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: dioxus_cli_opt::css::minify_css
4: dioxus_cli_opt::css::process_css
5: dioxus_cli_opt::file::process_file_to
6: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ /:more โฎ
โ App: โโโโโโโโโโโโโโโโโโโโโโโโโโ โ Platform: Web โ
โ Bundle: โโโโโโโโโโโโโโโโโโโโโโโโโโ โ App features: ["web"] โ
โ Status: Failed Serving at: โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ