Open wiiznokes opened 1 year ago
Hi! The issue seems to be coming from wrong cssparser
version. I incorrectly had the version set at 0.31.* instead of to 0.31.0. I've made a fix and pushed to main. Please try again!
Also, the examples are now made to be built with trunk rather than directly with wasm-pack
. Trunk is very simple; just install it and do
cd examples/web-todomvc
trunk serve
is this library only available for web with wasm or it also works on desktop ?
In the beginning there was a GTK4 version too. However, I decided to remove that for the time being. The concept behind Async UI is still quite new so I want to have one platform working well first.
I still get an error :cry:
lenaic@pop-os:~/Documents/dev/async_ui/examples/web-todomvc$ trunk serve
2023-07-06T00:03:29.635696Z INFO 📦 starting build
2023-07-06T00:03:29.636350Z INFO spawning asset pipelines
2023-07-06T00:03:29.697966Z INFO building web-todomvc
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
Compiling async_ui_web_macros v0.1.0 (/home/lenaic/Documents/dev/async_ui/async_ui_web_macros)
Compiling web-sys v0.3.64
error[E0432]: unresolved import `cssparser::RuleListParser`
--> async_ui_web_macros/src/css.rs:79:30
|
79 | QualifiedRuleParser, RuleListParser, Token,
| ^^^^^^^^^^^^^^
| |
| no `RuleListParser` in the root
| help: a similar name exists in the module: `RuleBodyParser`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `async_ui_web_macros` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
2023-07-06T00:03:33.630323Z ERROR ❌ error
error from HTML pipeline
Caused by:
0: error from asset pipeline
1: error during cargo build execution
2: cargo call returned a bad status
2023-07-06T00:03:33.630513Z INFO 📡 serving static assets at -> /
2023-07-06T00:03:33.630539Z INFO 📡 server listening at http://127.0.0.1:8080
Very strange. Can you make sure again that you have pulled the latest change (commit 3ab00b0), and that the file async_ui_web_macros/Cargo.toml
has the line
cssparser = "0.31.0"
at the end?
If the error still persist, maybe try cargo clean
?
I made git pull
so I should be fine. cargo clean
show this:
cargo clean
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
but it seems to work because i need to recompile the crates after. But i still get this error. Very strange indeed.
I misunderstood how cargo handles semantic versioning. Commit fd8158f889fe22b9bf641cb26718ced0471238bc should fix the issue. Please try it!
well, i have this new error now :smile: (even with the last commit)
lenaic@pop-os:~/Documents/dev/async_ui/examples/web-todomvc$ trunk serve
2023-07-11T17:49:53.298965Z INFO 📦 starting build
2023-07-11T17:49:53.299232Z INFO spawning asset pipelines
2023-07-11T17:49:53.364523Z INFO building web-todomvc
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
2023-07-11T17:49:53.426108Z INFO fetching cargo artifacts
2023-07-11T17:49:53.488682Z ERROR ❌ error
error from HTML pipeline
Caused by:
0: error from asset pipeline
1: cargo artifacts not found for target crate
2023-07-11T17:49:53.488866Z INFO 📡 serving static assets at -> /
2023-07-11T17:49:53.488889Z INFO 📡 server listening at http://127.0.0.1:8080
Seems to be a trunk issue. Can you try wasm-pack instead?
To build with wasm-pack
, replace the content of index.html
with this
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
</head>
<body>
<script type="module">
import init from './pkg/web_todomvc.js';
init();
</script>
</body>
</html>
Then run
wasm-pack build --dev --target web
Then you will have to serve the built content. I usually use microserver.
cargo install microserver
microserver
trunk serve
works for me
hi, newbie here. I saw in an issue that i needed
wasm-pack
. So i installed it with this.But now, i have this error:
Also, is this library only available for web with wasm or it also works on desktop ?