代码之家  ›  专栏  ›  技术社区  ›  Abe

优先级Web SDK btoa“未定义缓冲区”

  •  0
  • Abe  · 技术社区  · 8 年前

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

    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));
    

    这个问题最近突然出现。它以前工作得很好。我想可能是我升级了一个错误的软件包,所以我又回到了以前的版本。锁定文件并重建node\u modules文件夹,但未成功。

    我觉得这更像是一个纱线/npm包或优先级问题,而不是React native,但我不知所措。对我还能做什么有什么建议吗?

    更新: 我在这方面做得越多,尝试的东西越多,我觉得这越来越像是我的测试设置与我的live设置具有不同的本机功能的问题。对如何检查/解决该问题有何建议?

    1 回复  |  直到 8 年前
        1
  •  1
  •   neomib    8 年前

    这在的1.9.3版中已修复 priority-web-sdk .

    此外,这里还有一个指向Priority Master应用程序存储库的链接,该存储库是使用 react-native : https://github.com/PrioritySoftware/priority-master-react .