【发布时间】: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