dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Failed to copying tailwind.css

Open hackartists opened this issue 1 year ago โ€ข 1 comments

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 assets directory
  • import css file with asset! macro
  • dx serve

Expected behavior

  • It did work for 0.6.0-alpha.5

Screenshots

image

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

hackartists avatar Dec 09 '24 10:12 hackartists

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

emilbonnek avatar Dec 09 '24 21:12 emilbonnek

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:               โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

maincss-from-dioxus-0.5.zip

cheezecat avatar Jan 05 '25 04:01 cheezecat