leptos-tiptap
leptos-tiptap copied to clipboard
Running `leptos-tiptap` in an leptos SSR workspace
The tiptap instance does not run when integrating leptos-tiptap
into the start-axum-workspace
template from leptos. I suspect a configuration error on my side. Would appreciate some help in pinpointing the error.
I'm using leptos with ssr in a workspace project. The benefit of using workspaces is slightly better separation of backend and frontend. It saves on some #[cfg(feature = "ssr")]
and it's easier to extend the server code with non-leptos functionality. However, there are now three different packages, each with their own Cargo.toml that need to be configured correctly.
The problem is, the tiptap instance in this setup does not run. Even though everything appears to be present, the
I have set up an example project here, with the following steps:
-
$ cargo leptos new --git https://github.com/leptos-rs/start-axum-workspace
- update
wasm-bindgen
to version0.2.92
- add
leptos-tiptap
dependencies (see below for cargo.toml) - add
build.rs
(same as the demo-ssr example, except with the root path one dir up) - add the
Demo
leptos component toapp/lib.rs
(again same as demo-ssr example) - add the necessary
Script
tags toapp/lib.rs
Running the project (cargo leptos watch
) makes it appear as if everything is present:
- both tiptap JS files are built and present in the browser
- all elements from the demo are present
- a tiptap instance
div
is present (see below)
..but the tiptap instance does not actually do anything. There is an empty box where (in the demo) the WYSIWYG editor would show. Sadly, there are no error messages to debug, so I'm currently left clueless.
leptos-tiptap-instance
in browser:
<leptos-tiptap-instance id="id" data-hk="0-0-0-34" class=" " style=" display: block; width: auto; height: auto; border: 1px solid; padding: 0.5em; white-space: pre-wrap;;"></leptos-tiptap-instance>
Cargo.toml (workspace):
[dependencies]
...
leptos-tiptap = { version = "0.7", features = ["ssr"] }
leptos-tiptap-build = "0.2"
...
Cargo.toml (app):
[dependencies]
leptos-tiptap.workspace = true
[build-dependencies]
leptos-tiptap-build.workspace = true
[features]
ssr = [ ... "leptos-tiptap/ssr"]
Cargo.toml (server):
[dependencies]
leptos-tiptap = { workspace = true, features = ["ssr"] }
My current thoughts are that I'm missing some dependencies somewhere, but from the available docs I'm unable to determine which those might be. Any help would be appreciated!