Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to copying tailwind.css #3310

Closed
hackartists opened this issue Dec 9, 2024 · 2 comments · Fixed by #3509
Closed

Failed to copying tailwind.css #3310

hackartists opened this issue Dec 9, 2024 · 2 comments · Fixed by #3509
Assignees
Labels
bug Something isn't working manganis Related to the manganis crate

Comments

@hackartists
Copy link
Contributor

hackartists commented Dec 9, 2024

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

@emilbonnek
Copy link

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

@cheezecat
Copy link

cheezecat commented Jan 5, 2025

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

@ealmloff ealmloff self-assigned this Jan 7, 2025
@ealmloff ealmloff added bug Something isn't working manganis Related to the manganis crate labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working manganis Related to the manganis crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants