how to solve? error: undefined symbol: sendfile (referenced by top-level compiled C/C++ code)

Unity 2021.3.11f1c2, mac m1
8538542--1140626--upload_2022-10-25_22-16-57.jpg
Building Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js failed with output:
error: undefined symbol: _ZN14RefcountedData7ReleaseEv (referenced by top-level compiled C/C++ code)
warning: Link with -s LLD_REPORT_UNDEFINED to get more information on undefined symbols
warning: To disable errors for undefined symbols use -s ERROR_ON_UNDEFINED_SYMBOLS=0
warning: __ZN14RefcountedData7ReleaseEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: sendfile (referenced by top-level compiled C/C++ code)
warning: _sendfile may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
emcc2: error: '/Applications/Unity/Hub/Editor/2021.3.11f1c2/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/node/node /Applications/Unity/Hub/Editor/2021.3.11f1c2/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/src/compiler.js /var/folders/lj/1b_yv7ss7db44gwq37h0px5h0000gn/T/tmpu085u7d0.txt' failed (1)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

others:
8538542--1140632--upload_2022-10-25_22-18-44.jpg
8538542--1140638--upload_2022-10-25_22-19-47.jpg

8538542--1140629--upload_2022-10-25_22-18-2.jpg
8538542--1140635--upload_2022-10-25_22-18-56.jpg

Is this with an empty project or one that used to build but stopped creating builds just now? In the latter case, check what you changed since the last working build.

It may also help to test building with a newer Unity version (keep a backup of the project).

test also deleting library folder,
if you added some plugin recently that might cause it also.

and can test if building webgl 1.0 vs webgl 2.0 works.

i had same error caused by one asset store plugin, which the developer had then upgraded to work with webgl 2.
https://discussions.unity.com/t/867271/6

i got the same issue....don't know why...

[quote=“ChiuanWei”, post:4, topic: 898216]
i got the same issue…don’t know why…
[/quote]

Have you finally solved this problem

I saw a solution in ZhiHu.com, it says changing the strip code level can solve this issue. Try make your level to minimal. If you really need to strip your code, try to add link.xml.