收藏
回答

遇见了开发者工具中预览、真机调试、打包线上版本完全不一致表现的问题,请问如何解决?

微信开发者工具版本为:stable 1.06.2409140

三个不同环境的测试手机版本均为iPhone 15 Pro Max

线上版小程序名称为「小猫补光灯-花叔」

不同状态说明:

1、在预览模式下

2、在线上模式下

界面与预览模式完全一致,只是在点击右上角“相机”按钮后,不会出现权限请求,在界面上也没有出现预览框,无法完成拍照。

3、在真机调试模式下,界面完全空白,控制台大量报错

报错信息如下:

index.js:1 error run publib TypeError: Cannot read property 'Int8Array' of undefined
    at eval (eval at Ce.t.call.document (runtime.js:1), <anonymous>:2:82423)
    at Array.forEach (<anonymous>)
    at Module.8071 (eval at Ce.t.call.document (runtime.js:1), <anonymous>:2:82394)
    at r (eval at Ce.t.call.document (runtime.js:1), <anonymous>:2:82586)
    at eval (eval at Ce.t.call.document (runtime.js:1), <anonymous>:2:83808)
    at eval (eval at Ce.t.call.document (runtime.js:1), <anonymous>:2:83857)
    at eval (eval at Ce.t.call.document (runtime.js:1), <anonymous>:2:83861)
    at eval (eval at Ce.t.call.document (runtime.js:1), <anonymous>:2:3271579)
    at eval (<anonymous>)
    at Object.Ce.t.call.document (index.js:1)
value @ index.js:1
debug:///[__publibRunErrorHelper__]:4 2024/11/20下午12:25:19Public library failed to run
debug:///[__publibRunErrorHelper__]:5 There might be an error running the public library.
Please refer to: https://developers.weixin.qq.com/community/develop/doc/000cca451006984364d8a94c351808
eval @ debug:///[__publibRunErrorHelper__]:5
debug:///[__publibRunErrorHelper__]:6 Debug information:
debug:///[__publibRunErrorHelper__]:7 Object
index.js:1 ReferenceError: define is not defined
    at eval (eval at ye (runtime.js:1), <anonymous>:2:41)
    at eval (<anonymous>)
    at ye (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 subscribeHandler injected failed
value @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (typeof.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (regeneratorRuntime.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (asyncToGenerator.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (arrayWithHoles.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (iterableToArrayLimit.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (unsupportedIterableToArray.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (nonIterableRest.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (slicedToArray.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (Objectvalues.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (arrayLikeToArray.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (presets.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (camera.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (app.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (cameraPreview.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (shutterButton.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (controlPanel.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (colorWheel.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (brightnessControl.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (index.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (index.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 ReferenceError: define is not defined
    at eval (authorize.js:1)
    at eval (<anonymous>)
    at ye (index.js:1)
    at index.js:1
    at ve (index.js:1)
    at Ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
ye @ index.js:1
index.js:1 eval script evaluate_id #1 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
index.js:1 eval script evaluate_id #2 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
index.js:1 eval script evaluate_id #3 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
index.js:1 eval script evaluate_id #4 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:2)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
index.js:1 eval script evaluate_id #5 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:2)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
index.js:1 eval script evaluate_id #6 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
index.js:1 eval script evaluate_id #7 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
ce @ index.js:1
We @ index.js:1
Ge.ze.onmessage @ index.js:1
index.js:1 eval script evaluate_id #8 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
ce @ index.js:1
We @ index.js:1
Ge.ze.onmessage @ index.js:1
index.js:1 eval script evaluate_id #9 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
ce @ index.js:1
We @ index.js:1
Ge.ze.onmessage @ index.js:1
index.js:1 eval script evaluate_id #10 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
ce @ index.js:1
We @ index.js:1
Ge.ze.onmessage @ index.js:1
index.js:1 eval script evaluate_id #11 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)
value @ index.js:1
ce @ index.js:1
We @ index.js:1
Ge.ze.onmessage @ index.js:1
index.js:1 eval script evaluate_id #12 failed ReferenceError: WeixinJSBridge is not defined
    at eval (eval at ce (runtime.js:1), <anonymous>:1:3)
    at eval (<anonymous>)
    at ce (index.js:1)
    at We (index.js:1)
    at WebSocket.Ge.ze.onmessage (index.js:1)


回答关注问题邀请回答
收藏

1 个回答

  • 一笑皆春
    一笑皆春
    星期三 13:35

    一般线上版本跟体验版是一致的,前提是体验版关闭不校验域名,需要校验域名。

    星期三 13:35
    有用
    回复
登录 后发表内容