Unity发布WebGL,访问MySQL,在浏览器打开报错.

最近做Unity发布WebGL,访问MySQL数据库时遇到了一些问题,记录一下.

报错

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
uncaught exception: abort(163) at jsStackTrace (02.asm.work.unityweb:2:27460)
stackTrace (02.asm.work.unityweb:2:27631)
abort (02.asm.work.unityweb:4:38580)
NCu (02.asm.code.unityweb:38:1)
Lql (02.asm.code.unityweb:10:1)
iku (02.asm.code.unityweb:38:1)
qej (02.asm.code.unityweb:12:1)
Psu (02.asm.code.unityweb:38:1)
invoke_iiiii (02.asm.work.unityweb:2:348461)
OFt (02.asm.code.unityweb:28:1)
uQt (02.asm.code.unityweb:28:1)
gIa (02.asm.code.unityweb:11:1)
aIa (02.asm.code.unityweb:11:1)
WEc (02.asm.code.unityweb:17:1)
GEc (02.asm.code.unityweb:17:1)
fhd (02.asm.code.unityweb:29:1)
ehd (02.asm.code.unityweb:29:1)
ZLc (02.asm.code.unityweb:17:1)
qHc (02.asm.code.unityweb:17:1)
eHc (02.asm.code.unityweb:17:1)
Jtu (02.asm.code.unityweb:38:1)
browserIterationFunc (02.asm.work.unityweb:2:213135)
runIter (02.asm.work.unityweb:2:195189)
Browser_mainLoop_runner (02.asm.work.unityweb:2:214682)

If this abort() is unexpected build with -s ASSERTIONS=1 which can give more information.

打开浏览器控制台,看到具体信息

在这里插入图片描述

解决方案

查了一些资料,发现WebGL不能直接连接到数据库,这也是报错的原因所在.
可以看这篇博客:https://blog.csdn.net/sinat_39291423/article/details/103385706
可以看到博客的博主也有相关的其他博客:
https://blog.csdn.net/sinat_39291423/article/details/103402825

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值