【问题标题】:Priority-Web-SDK btoa "Buffer is not defined"Priority-Web-SDK btoa“未定义缓冲区”
【发布时间】:2018-02-21 13:17:36
【问题描述】:

我正在使用 create-react-native-app 构建一个 React Native 应用程序。该应用程序通过 API 连接到 Priority 没有错误,但是当我需要使用 Web-SDK 获取选择字段的选项时,它会引发错误:

SDK Error: ReferenceError: Buffer is not defined
at btoa (C:\...\node_modules\btoa\index.js:8)
at b64encode (C:\...\node_modules\priority-web-sdk\index.js:2744)
at $FormQuery (C:\...\node_modules\priority-web-sdk\index.js:3898)
at $GetRows (C:\...\node_modules\priority-web-sdk\index.js:3957)
at Form_1.GetRows (C:\...\node_modules\priority-web-sdk\index.js:4673)
at C:\...\node_modules\priority-web-sdk\index.js:6234
at tryCallTwo (C:\...\node_modules\promise\setimmediate\core.js:45)
at doResolve (C:\...\node_modules\promise\setimmediate\core.js:200)
at new Promise (C:\...\node_modules\promise\setimmediate\core.js:66)
at Object.gform.getRows (C:\...\node_modules\priority-web-sdk\index.js:6233)

**为简洁/隐私而编辑的实际文件路径。

我调用 getRows() 的代码

return login(configuration)
    .then(() => formStart('PORDERS', null, null, configuration.company, 1))
    .then(form => myForm = form)
    .then(() => myForm.setSearchFilter(filter))
    .then(() => myForm.getRows(1))
    .then(r => rows = r)
    .then(() => myForm.setActiveRow(1)) 
    .then(a => row = a)
    .then(() => myForm.choose('STATDES',rows.PORDERS[row.rowindex].STATDES))
    .then((response) => {return response.ChooseLine})
    .catch(err => console.log('SDK Error: ', err));

最近出现了这个问题。它以前工作正常。我想可能是我错误地升级了一个包,所以我恢复到以前版本的 yarn.lock 文件并重建了 node_modules 文件夹,但没有成功。

我觉得这更像是一个 yarn/npm 包或优先级问题,而不是 React-native,但我不知所措。关于我还能做什么的任何建议?

更新: 我在这方面工作得越多,尝试不同的东西越多,我觉得我的测试设置与我的实际设置具有不同的本机功能,这对我来说越来越像一个问题。有关如何检查/解决该问题的任何建议?

【问题讨论】:

    标签: react-native npm yarnpkg erp


    【解决方案1】:

    这已在 priority-web-sdk 的 1.9.3 版中得到修复。

    此外,这里是使用react-native 构建的Priority Master 应用程序库的链接:https://github.com/PrioritySoftware/priority-master-react

    【讨论】:

      猜你喜欢
      • 2021-11-02
      • 1970-01-01
      • 1970-01-01
      • 2022-01-21
      • 2022-01-28
      • 1970-01-01
      • 2021-10-12
      • 2022-01-14
      • 1970-01-01
      相关资源
      最近更新 更多