Open redgetan opened 2 days ago
Hey @redgetan, sorry to see you run into issues. Did you recently update? Can you reproduce this locally?
@bitsandfoxes you ask if there's a recent update because of the Unity caching issue where the new SDK doesn't take effect? But if a clean build is run, things work?
I only installed sentry-unity recently, so I didn't update from and older version. Here's the node.js server I'm using to run the webgl build locally
const express = require('express');
const compression = require('compression');
const path = require('path');
const app = express();
const port = 3000;
// Enable gzip compression for all responses
app.use(compression());
// Serve static files from the current directory
app.use(express.static(__dirname, {
setHeaders: (res, path) => {
if (path.endsWith('.br')) {
res.set('Content-Encoding', 'br');
res.set('Content-Type', 'application/wasm');
} else if (path.endsWith('.gz')) {
res.set('Content-Encoding', 'gzip');
res.set('Content-Type', 'application/wasm');
}
}
}));
// Start the server
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
@redgetan thanks for confirming that.
So even on a clean build, the same error comes up?
I ask because the stack trace has:
at FileStream__ctor_m16C2A184C2E9D43D0DC7ECFB1659F0299400E416 (http://localhost:3000/fishbait-web/Build/fishbait-web.wasm.gz:wasm-function[96162]:0x1d2bac3)
at FileStream__ctor_mA39506EF7A1F33FCA0199B880BE1D82217E33EEC (http://localhost:3000/fishbait-web/Build/fishbait-web.wasm.gz:wasm-function[96164]:0x1d2bf1b)
at File_OpenRead_m6181B052EB0E98D2E18FAC79E7744D766BA4244C (http://localhost:3000/fishbait-web/Build/fishbait-web.wasm.gz:wasm-function[71932]:0x173e307)
at FileSystemBase_OpenFileForReading_m34411126DEDE970472EB612A5C5E4C6AE2FB6EC5 (http://localhost:3000/fishbait-web/Build/fishbait-web.wasm.gz:wasm-function[34643]:0xc2bd72)
at Json_Load_TisRuntimeObject_m574C42900FEAA1E8D4B63FBDF82BB92B6539641C_gshared (http://localhost:3000/fishbait-web/Build/fishbait-web.wasm.gz:wasm-function[64074]:0x152cf80)
at GlobalSessionManager_U3C_ctorU3Eb__11_0_mCDF5B30D9B798A5C53F71ED0FAD8B9E01E8F1211
So this is happening when we're trying to persist a file so we can indicate the 'crash free' rate. But we added an option to disable that 2 versions ago:
Perhaps that's not being set on WebGL, could you try setting: options.DisableFileWrite = true;
on your runtime configuration?
More on how to configure the SDK programatically here: https://docs.sentry.io/platforms/unity/configuration/options/#programmatic-configuration
@bruno-garcia Yes. even on clean build, same error comes up. However, I was able to remove the error completely if I change exceptionSupport to something else other than WebGLExceptionSupport.None
Sentry Crashes
PlayerSettings.WebGL.exceptionSupport = WebGLExceptionSupport.None;
No Crash. Sentry working.
PlayerSettings.WebGL.exceptionSupport = WebGLExceptionSupport.FullWithoutStacktrace;
Oh that's great insight.
@bitsandfoxes is it possible to check if PlayerSettings.WebGL.exceptionSupport
is None
before we init Sentry?
We could print to the console saying
Sentry can't be initialized because
PlayerSettings.WebGL.exceptionSupport
is set toNone
. Please set it toebGLExceptionSupport.FullWithoutStacktrace
in order to have visibility on errors
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which version of the SDK? 2.2.1
How did you install the package? (Git-URL, Assetstore) git-url
Which version of Unity? 2022.3.37f1
Is this happening in Unity (editor) or on a player like Android, iOS, Windows? No errors in the unity (editor), but only on the webgl build
Steps to Reproduce
Without sentry, the webgl build runs perfectly fine on the browser. After adding sentry, it freezes/crashes during initialization.
Expected Result
No crash
Actual Result
Crashing (see logs + screenshot). Maybe file open related?
Any logs or screenshots