[LayaAirIDE3]LayaAirIDE 3.20-beta.2版本,打包时勾选压缩js时,运行打包后的资源会报错
LayaAirIDE 3.20-beta.2版本,打包时勾选压缩js时,运行时会报错是什么原因的? 不勾选压缩js,打包后可正常运行。
项目设置 --〉 编译 --〉 发行版本选项里,勾选 保留类和函数名称
您好,可以简单的发一个demo吗,我试了一些js压缩后发布,运行是正常的。
当前demo基于官方版本修改;es6改为es2020支持bigNumber;导入了viem库;代码中引用了viem中的代码;然后选择压缩js打包,就会报下面的错误。
在3.2.0-beta.2的IDE里,选择压缩js打包就不能运行, 不选择压缩js,能正常运行。在3.1的IDE即使选择压缩js也能正常打包的。
修改截图:
在3.2.0-beta.2的IDE里,选择压缩js打包就不能运行, 不选择压缩js,能正常运行。在3.1的IDE即使选择压缩js也能正常打包的。
修改截图:
hjy1234123 • 2024-08-19 01:33
保留类和函数名就起不到加密作用了,是否下个版本考虑修复这个问题的
layabox • 2024-08-19 16:31
@hjy1234123:这修复不了,不是我们的问题,有些特定的JS,就是不支持压缩的。报错是运行环境报的。
hjy1234123 • 2024-10-15 16:41
你好,使用了LayaAirIDE 3.2.0 正式版本,打包勾选了 保留类和函数依然不行,压缩js打包后,运行报错
bundle-b977b.js:1 Uncaught TypeError: Br is not a function
at node_modules/@noble/hashes/esm/sha3.js (bundle-b977b.js:1:36515)
at bundle-b977b.js:1:217
at node_modules/viem/_esm/utils/hash/keccak256.js (bundle-b977b.js:1:36701)
at bundle-b977b.js:1:217
at bundle-b977b.js:1:146633
at bundle-b977b.js:1:276988
node_modules/@noble/hashes/esm/sha3.js @ bundle-b977b.js:1
(anonymous) @ bundle-b977b.js:1
node_modules/viem/_esm/utils/hash/keccak256.js @ bundle-b977b.js:1
(anonymous) @ bundle-b977b.js:1
(anonymous) @ bundle-b977b.js:1
(anonymous) @ bundle-b977b.js:1
6The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. <URL>
laya.core-90107.js:1 Error loading Loading.ls:
Error: unknown type 'xmaaYG8AQ1yC07pr_JvyPA'
overrideMethod @ hook.js:591
(anonymous) @ laya.core-90107.js:1
Promise.then (async)
load @ laya.core-90107.js:1
open @ laya.core-90107.js:1
(anonymous) @ index-e1723.js:52
Promise.then (async)
(anonymous) @ index-e1723.js:48
(anonymous) @ index-e1723.js:61
Show 1 more frame
Show less
laya.core-90107.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_is3D')
at laya.core-90107.js:1:496055