Error when loading custom plugin, missing export get_plugin_schema_version
stevenliebregt opened this issue · comments
Steven Liebregt commented
No matter what I try, whenever I build a plugin, be it one I made myself or an official one like the sql plugin and then try to load it in my dprint.json
as a file I'm getting the following error:
Error resolving plugin ...: Error determining plugin schema version. Are you sure this is a dprint plugin? Missing export get_plugin_schema_version
Plugins are built using cargo build --release --target=wasm32-unknown-unknown
per docs.
What am I missing?
David Sherret commented
You'll need to compile with the wasm
feature as well (all the crates follow this pattern, but it's not prescribed):
cargo build --target wasm32-unknown-unknown --features wasm
That will add the wasm exports. The reason the separate feature is necessary is to allow people to use the formatter in wasm scenarios without automatically adding exports.