Nuxt OG Image relies heavily on third-party packages that have different compatibility requirements.
There are a number of bindings that can be used for each dependency: node, wasm, wasm-fs and false.
node binding is for default Node based environments.wasm and wasm-fs bindings are used to run WebAssembly. They are mostly used for WebWorker support.wasm-fs binding is for using WebAssembly in a development WebWorker development environment such as StackBlitz.false disables the dependency.chromiumSupports: node
Used to render browser screenshots.
This only works on Node based environments. However, it does not work on AWS Lambda as the Chromium binary is too large.
Due to the rendering times being slow, it's recommended to only use browser screenshots when prerendering them.
satoriSupports: node, wasm, wasm-fs
Used to render a HTML vNode tree into OG Images.
This is the default renderer, and works on all environments.
resvgSupports: node, wasm, wasm-fs
Used to transform SVGs into PNGs. This should work on all environments.
When installing using the node
binding, it can have issues resolving the correct binary. You may run into an issue like Cannot resolve "./resvgjs.android-arm64.node",
in which case you should manually set the binding to wasm or wasm-fs.
sharpSupports: node
Used to transform PNG to JPEG. This only works on Node based environments.
This is disabled by The dependency is quite heavy so it's disabled by default.
See the JPEGs guide for more information.
css-inlineSupports: node, wasm, wasm-fs
Used to support <style> tags within Vue SFCs.
Powered by css-inline.
In some instances, it may be useful to override the compatibility, so you can toggle features or use more optimised bindings for your environment.
export default defineNuxtConfig({
ogImage: {
compatibility: {
// disable chromium dependency for prerendering (skips the chromium install in CIs)
prerender: {
chromium: false
}
}
}
})
sharp - will use your local Sharp installchromium will use your local Chromium install, if availablechromium - will use your local Chromium install or install a chromium binary if not foundchromium - can't be used due to the binary sizesharp - can't be used due to some post-install scripts issuechromium - can't be used, no WASM supportsharp - can't be used, no WASM supportchromium - can't be used, no WASM supportsharp - can't be used, no WASM supportcss-inline - can't be used, no WASM supportThere is an open issue for custom fonts and images being broken in Cloudflare Workers. Please reply to the issue if you need this fixed.
chromium - can't be used, no WASM supportsharp - can't be used, no WASM supportAll examples are generated from the Nuxt OG Image Playground GitHub repo.





