【发布时间】:2020-10-03 05:21:03
【问题描述】:
我正在使用 Quasar、Electron 和串行端口设置一个测试项目。使用最小串行端口测试启动应用程序时,出现以下错误:
vue-router.esm.js?85f8:2128 TypeError: Cannot read property 'indexOf' of undefined
at Function.getFileName (bindings.js?d8c5:178)
at bindings (bindings.js?d8c5:82)
at eval (win32.js?0965:1)
at Object../node_modules/@serialport/bindings/lib/win32.js (vendor.js:340)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
at eval (index.js?3983:6)
at Object../node_modules/@serialport/bindings/lib/index.js (vendor.js:252)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
当我只包含串口包而不做任何事情时,甚至会发生错误。这似乎是一个基本问题。重现问题的代码:
<script lang="ts">
import { Vue, Component } from 'vue-property-decorator';
import SerialPort from 'serialport';
@Component
export default class Index extends Vue {
test() {
console.log('test', SerialPort);
}
}
</script>
我尝试了我能在这里找到的一切,在 Quasar 论坛等。pp.:电子重建,尝试将串行端口配置为外部依赖项,...
我不太确定重建过程是否按预期工作,但我不知道要检查什么以确保它正常工作。带有串行端口的电子示例项目正在为我工作。也许是类星体相关的东西?
我能否获得有关重建过程的更多信息?我尝试了不同的组合来指定版本,但没有任何帮助。
我也asked这个问题作为串行端口存储库中的一个问题,但将其添加到 vue.config.js 中不起作用,因为我使用 Quasar 作为 CLI 选项。
我认为主要问题是如何在 Quasar 到位时为电子正确重建串行端口,这似乎没有按预期工作。
【问题讨论】:
标签: electron quasar node-serialport