This crate provides a workspace for the web client for Ambient.
The client is compiled using the wasm32-unknown-unknown
toolchain into a .wasm
file, which is then imported as an ECMAScript module.
Note: you need to serve a package using ambient
for the web client to connect to.
- Node
>= v.19
- WebGPU supported web browser (recent enough)
cargo campfire web serve
This build the client and launch vite dev server
binding to :5173
. See the command output for exact url.
Whenever a file changes the client will automatically rebuild and the changes will be reflected in the browser.
Note: the self-signed certificate is only valid for 127.0.0.1
Note: Skip this section if you are connecting to a hosted Package.
If using self-signed certificates, you need to tell Chrome to trust it.
cargo cf web open-browser
Note: If you are on mac make sure you close any existing Chrome instances using Quit
-
Bad CPU type in executable:
Occurs on Mac M1 and M2 as the
wasm-pack
installer attempts to downloadwasm-bindgen
.This is fixed by doing
cargo install -f wasm-bindgen
manually -
openssl issue :
try:
export NODE_OPTIONS=--openssl-legacy-provider
on unix orset NODE_OPTIONS=--openssl-legacy-provider
on windows