diff --git a/cli/src/api/templates/js-binding.ts b/cli/src/api/templates/js-binding.ts index 95413c62..5675d0fc 100644 --- a/cli/src/api/templates/js-binding.ts +++ b/cli/src/api/templates/js-binding.ts @@ -328,14 +328,18 @@ switch (platform) { if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { try { nativeBinding = require('./${localName}.wasi.cjs') - } catch { - // ignore + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err) + } } if (!nativeBinding) { try { nativeBinding = require('${pkgName}-wasm32-wasi') } catch (err) { - console.error(err) + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err) + } } } }