收藏
回答

wx.getFileSystemManager().readFile报错,not node js ?

/**
** 复现流程: Android手机(最好是小米手机), 使用全局录音管理器,在安静环境内,频繁多次短时间内开始/结束录音(间隔越短越容易复现),
** 每次录音结束后都走下面的代码转化为base64, 有很大几率复现
*/    

 constfs = wx.getFileSystemManager()
      // tempFilePath 为全局唯一录音管理器获取到的录音临时文件地址, 示例:wxfile://tmp_f88bf788bfd6eec1f5dee788bf91c096.mp3
    if (!tempFilePath) {
      Taro.showToast({
        title: '录音文件路径为空',
        icon: 'none',
        duration: 2000
      })
      resetRecordingState()
      return
    }
    fs.readFile({
      filePath: tempFilePath,
      encoding: 'base64',
         success: (res) => {
             console.log(res.data)
            // 报错Error: not node js file system!path:/saaa_config.json; go __invokeHandler__ readFile worker?
            // 报错后偶现data为空字符串   
         }
      })

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    04-22
    有用
    回复
登录 后发表内容