Open jkelleyrtp opened 1 month ago
Fullstack is just broken due to a port forwarding issue
Is this the same as (I no longer think it's the same issue and I don't have the port forwarding issue):
[x] "Failed to find index.html" Fullstack panic
[app] thread 'main' panicked at /cargo/git/checkouts/dioxus-1e619ce595d3799d/bd58a92/packages/fullstack/src/serve_config.rs:91:37:
[app] 2024-08-04T12:04:46.395679Z WARN dioxus_cli_config: A library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application.
[app] Failed to find index.html. Make sure the index_path is set correctly and the WASM application has been built.: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[app] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
?
Update 1:
The commit that introduced this is 0acfe3739. Which is weird as it only adds an error/display implementation?
Update 2:
After a bit of discussion and messing with crate versions, I was finally able to fix the error: I used the latest git version (4c0fefbcb) and had to patch manganis version (which is pinned to a week-old commit):
It worked without patching the manganis-cli-support
crate. Then I also had to use the PR version of the template + a bit of patching (including re-patching the manganis crate in the fullstack template).
Update 3:
After removing manganis dependency in the PR the build was successful! For some reason manganis dependency in dioxus crate doesn't have to be updated.
[x] Some messages sometimes are written on top of the UI
Update:
Was fixed in 63e7aab4e.
[x] I can't see scrollbar thumb in TUI (maybe it's only visible when the logs are filling out the screen?) in kitty + zellij
Update:
Scrollbar thumb only shows up when logs can't fully be shown in the TUI.
[ ] Add support for a job in the background via Ctrl+Z (have to re-launch dx serve
every time or open a new terminal in the same directory)
Update 1:
Some problems and progress info here: https://github.com/crossterm-rs/crossterm/issues/494#issuecomment-2284869555.
Update 2:
[ ] New logs ([app] ... INFO dioxus_fullstack::render: Rebuilding vdom
) are appended above the older logs ([dev]
), therefore the older ones are being pushed down with each new entry. #2846
[ ] Show the time it took for the build/rebuild process to complete (and it's sometimes very useful or to just have an approximate value in your head just in case)
Either include the time of all steps (build + optimize assets/Wasm etc.) and/or include time for each step (requires more space, but it can look very cool/nice and also be even more useful in benchmarking and stuff; maybe can be enabled with --verbose
or something)
[ ] When the status is build failed
the build error is in the [2] build
tab, but the CLI changes the tab to [1] console
. Same with the [app]
logs that are added in the build
tab (not visible unless you change the tab). #2846
[ ] console
and build
tab names in the TUI are confusing. Plus, I don't yet understand which logs will go where and do they really need to be separated (some probably do). And additionally, the tab is automatically being switched upon build completion (or failure) while at the same time still putting some logs in the now hidden tab.
[x] [r] reload
should be renamed to [r] rebuild
and the TUI's status: finished
should be updated, otherwise I have no idea if anything is working or is it frozen/broken. The only visually understandable cue is the toast in the browser tab (which you can easily miss). #2840
[ ] After inspecting the dx init
/dx new
code I found that it has been changed multiple times since I last touched it. This in turn broke the semantic of the subcommands and also introduced some bugs.
An example of semantic breakage is the fact that now "name" can accept nested dir paths (a/b/c
). An example of bugs is the fact that if "name" and "destination" aren't set then CLI will panic.
I've started working on rewriting the logic and argument names etc. It won't break simple and mostly used use cases, but will introduce breaking changes in general.
Update:
[ ] Can't use non-default branch when using cargo-generate template URL (to dioxus-template). Specifically, I can't create reproducible example with current version of the CLI while using unmerged PR branch in dioxus-template. https://github.com/DioxusLabs/dioxus/pull/2822
[ ] dx clean
doesn't show any progress or how many GiB it has removed. https://github.com/DioxusLabs/dioxus/pull/2934
I will put non-CLI issues here (but they are emerged from dx serve
):
[ ] After a successful build, removing any of the a {}
elements (including the img
itself) causes the img
/SVG to disappear without the ability to restore it (only via tab reload). OK, any hot-reloadable change makes the image disappear.
rsx! {
head::Link { rel: "stylesheet", href: asset!("./assets/main.css") }
img { src: asset!("./assets/header.svg"), id: "header" }
div { id: "links",
a { href: "https://dioxuslabs.com/learn/0.5/", "📚 Learn Dioxus" }
a { href: "https://dioxuslabs.com/awesome", "🚀 Awesome Dioxus" }
a { href: "https://github.com/dioxus-community/", "📡 Community Libraries" }
a { href: "https://github.com/DioxusLabs/dioxus-std", "⚙️ Dioxus Standard Library" }
a { href: "https://marketplace.visualstudio.com/items?itemName=DioxusLabs.dioxus",
"💫 VSCode Extension"
}
a { href: "https://discord.gg/XgGxMSkvUM", "👋 Community Discord" }
}
}
src
dir when editing the main.rs
file) path autocompletion plugin. This probably would require either changing settings to crate root-relative paths or a dedicated Dioxus LSP server that can provide the correct paths (even using fuzzy find for easier/faster finding of a file) in a certain context (inside asset!("")
) and much more (I think a Tailwind CSS support was previously mentioned or something else).[ ] After a sequence of asset macro changes (or a single bad one) the final result can be: unapplied CSS that is fixed only with a rebuild.
I changed ./
in asset!("./assets/header.svg")
to ././
and then to ./././
and the page became a white mess after the last rebuild was finished. I don't know if this is just because of the macro or manganis or something else. What is also interesting is that the changed asset string was for an SVG, but I think both of the assets failed to load in the end.
Notes:
There was a "quirk" once when I tried to build the project once more. I was surprised since it should've succeed like it did the previous time but instead (After closing the TUI) it showed:
[dev] 2024-08-07T19:17:43.924546Z INFO dx::builder::cargo: Copying public assets to the output directory...
[dev] 2024-08-07T19:17:43.926021Z INFO dx::builder::web: Running wasm-bindgen
[dev] 2024-08-07T19:17:43.937072Z0ERROR9dx::builder::web: Bindgen build failed: JoinError::Panic(Id(25), ...)
[dev] 2024-08-07T19:17:43.937529Z INFO dx::builder::web: Attempting to recover from bindgen failure by setting the wasm-bindgen version to 0.2.92...thread 'tokio-runtime-worker' panicked at packages/cli/src/build
[dev] 2024-08-07T19:17:46.275032Z INFO dx::builder::web: Successfully updated wasm-bindgen to 0.2.92
I thought that it's a one-off problem without any reproduction ability so I didn't copy the additional logs in the TUI (which I thought would all be outside of it, but only a part was outside). Running the same thing for the 3rd time again succeeded with no errors. But in the end, it's worth noting that something like this can happen.
Add to the list:
Another thing to discuss: #2857
Fullstack is just broken due to a port forwarding issue
Is this the same as (I no longer think it's the same issue and I don't have the port forwarding issue):
* [x] "Failed to find index.html" Fullstack panic ``` [app] thread 'main' panicked at /cargo/git/checkouts/dioxus-1e619ce595d3799d/bd58a92/packages/fullstack/src/serve_config.rs:91:37: [app] 2024-08-04T12:04:46.395679Z WARN dioxus_cli_config: A library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application. [app] Failed to find index.html. Make sure the index_path is set correctly and the WASM application has been built.: Os { code: 2, kind: NotFound, message: "No such file or directory" } [app] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
I have been able to work around this in 0.6.0-alpha.2
by setting out_dir
to dist/public
. It looks like https://github.com/DioxusLabs/dioxus-template/pull/44 should be adjusted to use this since https://github.com/DioxusLabs/dioxus/blob/1dfa1b5e7f39b8ccd2e6b18bd9077d05e82d5504/packages/fullstack/src/serve_config.rs#L57 will use public_path()
if index_path
is not set.
Update: This only works once. If dist/public
exists, then next build will try to find the index in dist/public/public
. It seems you need a build with out_dir
for dist/public
then set out_dir
back to dist
.
Problem
We have a number of quirks / bugs in the CLI post-rewrite that need to be resolved before releasing to the general public.
This issue is where we put them.