淘宝小游戏 使用ByteBuffer报错

  • Creator 版本: 3.8.3

  • 目标平台: 淘宝小游戏开发者工具调试和真机预览

  • 重现方式:

  1. npm install bytebuffer
    2.修改node_modules\bytebuffer\package.json
    image
    image
    3.使用bytebuffer
    image
    4.构建发布
  • 首个报错:index-19093f03.js:1 TypeError: o is not a constructor
    at n.start (index.js:5:1296)
    at director-e735b225.js:1:528828
    at t._invoke (director-e735b225.js:1:528528)
    at i.invoke (director-e735b225.js:1:527808)
  • 之前哪个版本是正常的: 构建勾选调试模式正常
  • 重现概率: 必现

淘宝有自己的转换接口,用他的


是使用这个吗[quote=“gong87034234, post:2, topic:169613, full:true”]
淘宝有自己的转换接口,用他的

https://github.com/Gongxh0901/kunpocc-net
可以参考这个

只是使用ByteBuffer来处理ArrayBuffer数据,还没到使用淘宝的接口,而且构建勾选调试模式是能正常使用的

有没有可能是js在不同环境的兼容性问题

可以试试在bytebuffer.js里面兼容性代码那里,把amd那段屏蔽掉看看

移除amd内容后正常


感谢大佬