Native targets
The published package loads one napi-rs binary selected from the current operating system, architecture, and Linux libc. No JavaScript or WASI implementation is bundled.
Supported targets
| Rust target | Platform package | Runtime |
|---|---|---|
aarch64-apple-darwin | @amamo/mdx-darwin-arm64 | macOS arm64 |
x86_64-apple-darwin | @amamo/mdx-darwin-x64 | macOS x64 |
aarch64-unknown-linux-gnu | @amamo/mdx-linux-arm64-gnu | Linux arm64 glibc |
x86_64-unknown-linux-gnu | @amamo/mdx-linux-x64-gnu | Linux x64 glibc |
aarch64-unknown-linux-musl | @amamo/mdx-linux-arm64-musl | Linux arm64 musl |
x86_64-unknown-linux-musl | @amamo/mdx-linux-x64-musl | Linux x64 musl |
x86_64-pc-windows-msvc | @amamo/mdx-win32-x64-msvc | Windows x64 |
When the binding loads
createCompiler() normalizes the config and may initialize Shiki without loading Rust. The matching
native binary loads lazily on the first build() or transform(). Its platform package must have
the exact same version as the root package.
| Top-level error | Meaning |
|---|---|
AMAMO_NATIVE_UNSUPPORTED | The OS or CPU has no known target mapping. |
AMAMO_NATIVE_UNAVAILABLE | The target is known, but neither local nor packaged binding loaded. |
A package version mismatch appears as AMAMO_NATIVE_VERSION_MISMATCH inside the
AMAMO_NATIVE_UNAVAILABLE aggregate cause, not as the top-level loader error.
If installation succeeded on another machine, reinstall dependencies on the current target. Package
manager caches are safe; a copied node_modules directory is not.
Node.js requirement
The root and platform packages require Node.js 20.19 or newer.
Shiki does not replace the native binding
highlight.engine only changes how fenced code is highlighted. Choosing javascript does not
provide a JavaScript fallback for MDX compilation; the application still needs one of the matching
platform packages above. See Configuration for highlighting options.