{"id":18449,"library":"jazz-wasm","title":"jazz-wasm","description":"WebAssembly bindings for the Jazz database engine, a local-first, real-time collaborative CRDT database. This package provides a WASM build of the core cojson library, enabling high-performance use in browser and Node.js environments. Current stable version is v0.20.17, with alpha releases for v2.0.0. Jazz is built on top of the CoJSON CRDT library and supports transparent sync, offline-first, and conflict-free replicated data types (CRDTs). Key differentiators include automatic conflict resolution, no central server required, and integrated reactive queries for real-time UI updates. Jazz-wasm specifically targets environments where native bindings are unavailable or where a portable binary is needed. It ships TypeScript types and is designed to be used alongside jazz-tools.","status":"active","version":"2.0.0-alpha.2","language":"javascript","source_language":"en","source_url":"https://github.com/garden-co/jazz","tags":["javascript","crdt","database","local-first","wasm","typescript"],"install":[{"cmd":"npm install jazz-wasm","lang":"bash","label":"npm"},{"cmd":"yarn add jazz-wasm","lang":"bash","label":"yarn"},{"cmd":"pnpm add jazz-wasm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core library for CRDT and sync logic","package":"cojson","optional":false}],"imports":[{"note":"jazz-wasm is a side-effect import that initializes the WASM module. You must import it before using jazz-tools or cojson.","symbol":"default","correct":"import 'jazz-wasm'"},{"note":"The package is ESM-only, especially since v2.0.0-alpha. CommonJS require may fail in Node.js.","wrong":"const { initialize } = require('jazz-wasm')","symbol":"initialize","correct":"import { initialize } from 'jazz-wasm'"},{"note":"The export is named 'ready', not 'waitForReady'. It is a Promise that resolves when the WASM module is fully loaded.","wrong":"import { waitForReady } from 'jazz-wasm'","symbol":"ready","correct":"import { ready } from 'jazz-wasm'"}],"quickstart":{"code":"import 'jazz-wasm';\nimport { co } from 'jazz-tools';\n\n// Create a simple collaborative counter\nconst counter = co.create({ value: 0 });\n\n// Listen for changes\ncounter.subscribe(() => {\n  console.log('Counter:', counter.value);\n});\n\n// Update the counter\ncounter.value += 1;","lang":"typescript","description":"Shows basic usage: import jazz-wasm for WASM initialization, then use jazz-tools co API to create and observe a collaborative counter."},"warnings":[{"fix":"Change require() calls to import statements. If necessary, use dynamic import() as a fallback.","message":"jazz-wasm v2.0.0-alpha drops support for CommonJS require(). Use ESM imports only.","severity":"breaking","affected_versions":">=2.0.0-alpha"},{"fix":"Update imports to use 'cojson-core-wasm' instead of 'jazz-wasm'.","message":"The 'jazz-wasm' package is being renamed to 'cojson-core-wasm' starting from v0.20.17.","severity":"deprecated","affected_versions":">=0.20.17"},{"fix":"Ensure 'jazz-wasm' (or 'cojson-core-wasm') is imported at the very top of your entry point.","message":"jazz-wasm must be imported before any jazz-tools or cojson usage. Failure results in missing WASM module errors.","severity":"gotcha","affected_versions":">=0.20.0"},{"fix":"Serve your application over HTTPS in production. During development, use localhost.","message":"The WASM module requires a secure context (HTTPS or localhost) in browsers. Mixed content may block loading.","severity":"gotcha","affected_versions":">=0.20.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install jazz-wasm@latest' and ensure import path is correct (e.g., 'import 'jazz-wasm'').","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'jazz-wasm'"},{"fix":"Verify the WASM file is served at the correct location, enable CORS if needed, and use HTTPS/localhost.","cause":"WASM file cannot be loaded (CORS, missing file, or non-secure context).","error":"TypeError: Failed to fetch dynamically imported module: https://example.com/jazz-wasm.wasm"},{"fix":"Ensure jazz-wasm and cojson versions match (e.g., both 0.20.x). Clear cache and reinstall.","cause":"Corrupt WASM binary or mismatch between jazz-wasm version and cojson version.","error":"Uncaught (in promise) RuntimeError: memory access out of bounds"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}