Skip to content

A template for using Leptos ssr + server functions in a Cloudflare worker

License

Notifications You must be signed in to change notification settings

BrandonDyer64/leptos-workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leptos on Workers

A template for using Leptos ssr + server functions in a Cloudflare worker.

Prerequisites

Rust

Install Rust from rustup.rs. Then:

cargo install cargo-leptos --locked

Wrangler

You'll need some version of Node.js. I personally recommend using nvm. Then:

npm install --global wrangler

Run locally

wrangler dev

Run on Cloudflare

wrangler deploy

Troubleshooting

function wbg:__something must be callable

Q: I'm getting an error like this in my console:

- Unhandled Promise Rejection: LinkError: import function wbg:__wbindgen_closure_wrapper268 must be callable

A: You need to hard refresh in your browser between compiles

  • Firefox/Chrome: Ctrl-Shift-R or ⌘ R
  • Safari: ⌥ ⌘ E + ⌘ R

About

A template for using Leptos ssr + server functions in a Cloudflare worker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages