首页 / 浏览问题 / 三维GIS / 问题详情
unity2019发布webgl浏览器Atomics.wake报错
2EXP 2023年03月31日
“如果浏览器版本号是 86 版本之后的,需要修改以下内容:找到并打开引擎目录\Editor\ Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src 下的 library_pthread.js 文件。 之后将 Atomics.wake 改为 Atomics.notify” 按教程替换,浏览器报错

浏览器版本Version 111.0.5563.147 (Official Build) (64-bit)

UnityLoader.js:1178 exception thrown: TypeError: Atomics.wake is not a function,TypeError: Atomics.wake is not a function
    at _emscripten_futex_wake (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:14226:20)
    at ___pthread_mutex_unlock (wasm://wasm/0a7d4712:wasm-function[93152]:0x2237079)
    at _malloc (wasm://wasm/0a7d4712:wasm-function[92672]:0x221f4bb)
    at __ZN17LowLevelAllocator6MallocEm (wasm://wasm/0a7d4712:wasm-function[8743]:0x3331dc)
    at __ZN21UnityDefaultAllocatorI17LowLevelAllocatorE8AllocateEmi (wasm://wasm/0a7d4712:wasm-function[8729]:0x332412)
    at __ZN13MemoryManager8AllocateEmmRK10MemLabelId15AllocateOptionsPKci (wasm://wasm/0a7d4712:wasm-function[7336]:0x2bce6b)
    at __Z15malloc_internalmmRK10MemLabelId15AllocateOptionsPKci (wasm://wasm/0a7d4712:wasm-function[7334]:0x2bc7de)
    at __ZN9profiling19DispatchBuffersPool18PreallocateBuffersEv (wasm://wasm/0a7d4712:wasm-function[8658]:0x32e46c)
    at __ZN9profiling10Dispatcher6EnableEj (wasm://wasm/0a7d4712:wasm-function[8657]:0x32e3a5)
    at __ZN9profiling8Profiler10SetEnabledEb (wasm://wasm/0a7d4712:wasm-function[8656]:0x32e336)
    at __ZN9profiling8Profiler16SetProfilingModeE13ProfilerModes (wasm://wasm/0a7d4712:wasm-function[8652]:0x32e2b2)
    at __Z20profiler_set_enabledb (wasm://wasm/0a7d4712:wasm-function[8651]:0x32e291)
    at __ZN9profiling8Profiler10InitializeEbm (wasm://wasm/0a7d4712:wasm-function[8645]:0x32d9dc)
    at __Z19profiler_initializev (wasm://wasm/0a7d4712:wasm-function[8634]:0x32d09d)
    at _InjectProfilerSample (wasm://wasm/0a7d4712:wasm-function[15911]:0x5c7510)
    at blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:34693:48
    at Object.ccall (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:449:17)
    at _JS_Profiler_InjectJobs (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:5775:52)
    at __Z15InitWebGLPlayeriPPc (wasm://wasm/0a7d4712:wasm-function[15913]:0x5c7665)
    at _main (wasm://wasm/0a7d4712:wasm-function[15912]:0x5c7553)
    at Object._main (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:40478:32)
    at Object.callMain (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43363:28)
    at doRun (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43399:58)
    at run (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43411:3)
    at runCaller (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43347:28)
    at removeRunDependency (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:1038:4)
    at blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:1049:4
    at Worker.<anonymous> (blob:http://localhost:13553/d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:6841:8)
printErr @ UnityLoader.js:1178
callMain @ d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43376
doRun @ d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43399
run @ d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43411
runCaller @ d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:43347
removeRunDependency @ d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:1038
(anonymous) @ d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:1049
(anonymous) @ d155f4ec-b668-40bb-9f35-2d5e9ba0b4fc:6841
UnityLoader.js:417 Invoking error handler due to
Uncaught TypeError: Atomics.wake is not a function

1个回答

您好,请先确认是否是谷歌浏览器86以后的版本,从报错信息来看,是Atomics.wake这个方法导致的,在咱们的帮助手册中请按照步骤将以下两个地方的Atomics.wake改为Atomics.notify,如下图。该文件路径在unity软件安装目录下

852EXP 2023年03月31日

浏览器版本是Version 111.0.5563.147 (Official Build) (64-bit)。

而且我已经按照教程替换了 library_pthread.jssad

我刚才本地测试,使用Unity2019.4.36f1c1版本,谷歌浏览器111.0.5563.147(正式版本) (64 位),开启浏览器多线程:

1、搜索Chrome://flags

2、在 Experiments 界面顶部搜索框,搜索 Parallel downloading。

3、将该选项的开关,更改为 Enabled

可打包到浏览器,麻烦提供一下邮箱,我将我本地使用的插件包发你一份

95897926@qq.com

万分感谢
请问发送了吗?

我改用你的2019.4.36版本后,老的报错没了,但是又有新的报错

UnityLoader.js:1178 exception thrown: RuntimeError: float unrepresentable in integer range,RuntimeError: float unrepresentable in integer rangeangel

加您了,我将新包发您验证一下
请问解决了么? 我也出现这个问题了
...