fix(cli): log more wasi load errors

This commit is contained in:
LongYinan 2024-02-08 20:48:30 +08:00
parent 0205fd976e
commit ff2ccc9f37
No known key found for this signature in database
GPG key ID: 30B1140CE1C07C99

View file

@ -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)
}
}
}
}