收藏
回答

在小程序中引入插件中调用createOffscreenCanvas接口报异常错误,如何解决?

微信开发者工具v1.02.1911180 最新版本,

由于camera不支持微信开发者工具调试,所以使用真机调试,手机安装的微信版本7.0.11

在引入插件中调用createOffscreenCanvas接口报2个异常错误

canvas: wx.createOffscreenCanvas()


2个异常报错的信息如下:

appServiceSDKScriptError (unknown)

Pt.default.OffscreenCanvas is not a constructor; at wx.createOffscreenCanvas

TypeError: Pt.default.OffscreenCanvas is not a constructor

    at Vt (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:809537)

    at Object.Wt (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:808231)

    at Object.f.(anonymous function) (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:888622)

    at Object.eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:587283)

    at Function.eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1401835)

    at Object.eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:541980)

    at pe.onLaunch (weapp:///app.js:15:18)

    at pe.eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1649604)

    at new pe (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1650360)

    at Function.eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1650774)



thirdScriptError (unknown)

Cannot assign to read only property 'btoa' of object '[object Window]';at App lifeCycleMethod onLaunch function

TypeError: Cannot assign to read only property 'btoa' of object '[object Window]'

    at e ([__wxPluginCode__]:1095:45)

    at Object.exports.setupWechatPlatform ([__wxPluginCode__]:1095:1483)

    at Object.exports.configPlugin ([__wxPluginCode__]:1071:148)

    at pe.onLaunch (weapp:///app.js:9:12)

    at pe.eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1649604)

    at new pe (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1650360)

    at Function.eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1650774)

    at eval (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1637680)

    at eval (weapp:///app.js:7:1)

    at require (eval at n.call.document (http://127.0.0.1:63151/remote-debug/runtime.js?devtools_ignore=true:1:8753), <anonymous>:2:1685185)



最后一次编辑于  03-14
回答关注问题邀请回答
收藏

2 个回答

  • phoenixor
    phoenixor
    03-14

    canvas2D不支持真机调试

    03-14
    赞同
    回复 2
    • 南京迅立
      南京迅立
      03-15
      微信开发者工具不支持调试,真机也不支持调试。
      那只能通过发布版本后来测试吗?
      03-15
      回复
    • phoenixor
      phoenixor
      03-15回复南京迅立
      只能真机预览看看效果罗,现在还是公测阶段
      03-15
      回复
  • 南京迅立
    南京迅立
    03-14

    手机型号华为P30

    03-14
    赞同
    回复
登录 后发表内容
问题标签