ReferenceError:导航器未在“npm run build”Nextjs @andyet/simplewebrtc 上定义

时间:2021-06-17 10:10:39

标签: next.js

我正在使用@andyet/simplewebrtc 创建视频聊天应用程序。我正在使用 nextjs 动态导入。在本地主机上一切正常,但是当我尝试使用“npm run build”创建构建时,我发现导航器未定义。

<块引用>

发生构建错误 ReferenceError:导航器未定义 在对象。 (/Users/apple/Documents/React Mac/next-webrtc/next-webrtc/node_modules/@andyet/simplewebrtc/lib/Hark.js:4:56) 在 Module._compile (internal/modules/cjs/loader.js:1063:30) 在 Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) 在 Module.load (internal/modules/cjs/loader.js:928:32) 在 Function.Module._load (internal/modules/cjs/loader.js:769:14) 在 Module.require (internal/modules/cjs/loader.js:952:19) 在要求 (internal/modules/cjs/helpers.js:88:18) 在对象。 (/Users/apple/Documents/React Mac/next-webrtc/next-webrtc/node_modules/@andyet/simplewebrtc/actions/Media.js:5:40) 在 Module._compile (internal/modules/cjs/loader.js:1063:30) 在 Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) { 类型:'参考错误' }

1 个答案:

答案 0 :(得分:0)

只需升级到@andyet/simplewebrtc 1.30.2 版即可解决问题。他们之前升级到这个版本,它与nextjs不兼容