stride3d/stride · error · InvalidOperationException
EffectCompiler returned no shader and no compilation error.
Error message
EffectCompiler returned no shader and no compilation error.
What it means
After CheckResult passes (no compile errors), EffectSystem asserts that the compiler returned actual shader bytecode. If EffectBytecodeCompilerResult.Bytecode is null despite a clean log, this internal invariant is violated and InvalidOperationException is thrown.
Solutions
- Update/reinstall the Stride compiler packages so compiler and runtime versions match.
- Clear the shader cache (obj/strip, shader cache folders) and rebuild.
- If a custom IEffectCompiler is used, ensure Bytecode is set on success.
- File/report as a bug with the effect name if using stock Stride.
Example fix
// custom compiler before
return new EffectBytecodeCompilerResult { CompilationLog = log }; // Bytecode never set
// after
return new EffectBytecodeCompilerResult { Bytecode = compiledBytecode, CompilationLog = log }; Defensive patterns
Strategy: try-catch
Try / catch
try { var effect = effectSystem.LoadEffect("MyEffect"); }
catch (InvalidOperationException ex) when (ex.Message.Contains("returned no shader"))
{
log.Error(ex, "EffectCompiler produced no bytecode; clear shader cache and verify compiler/runtime versions");
} Prevention
- Keep Stride runtime and EffectCompiler packages at identical versions.
- Clear shader cache directories when upgrading Stride.
- Treat this as a bug report trigger if it reproduces with stock Stride.
When it happens
Trigger: A compiler plugin/backend returning success without producing bytecode; custom EffectCompiler implementations that forget to set Bytecode; broken compiler cache entries.
Common situations: Using a custom or outdated EffectCompiler pipeline (e.g. mismatched Stride compiler assemblies), or a corrupted shader cache.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Custom strides is not supported with packed PixelFormats
- Could not compile shader. See error messages:
- EffectSystem has been disposed. This Effect compilation has…
- Unable to find the base
- Unable to find the graph corresponding to the base part
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/84bb4a15704f06b1.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Rendering/Rendering/EffectSystem.cs:203
lock (cachedEffects)
{
if (!isInitialized)
throw new ObjectDisposedException(nameof(EffectSystem), "EffectSystem has been disposed. This Effect compilation has been cancelled.");
if (effectBytecodeCompilerResult.CompilationLog.HasErrors)
{
// Unregister result
// TODO: Should we keep it so that failure never change?
if (earlyCompilerCache.TryGetValue(effectName, out List<CompilerResults> effectCompilerResults))
{
effectCompilerResults.Remove(compilerResult);
}
}
CheckResult(effectBytecodeCompilerResult.CompilationLog);
var bytecode = effectBytecodeCompilerResult.Bytecode
?? throw new InvalidOperationException("EffectCompiler returned no shader and no compilation error.");
if (!cachedEffects.TryGetValue(bytecode, out effect))
{
effect = new Effect(GraphicsDevice, bytecode) { Name = effectName };
cachedEffects.Add(bytecode, effect);
#if STRIDE_PLATFORM_DESKTOP
foreach (var type in bytecode.HashSources.Keys)
{
var storagePath = EffectCompilerBase.GetStoragePathFromShaderType(type);
if (!FileProvider.TryGetFileLocation(storagePath, out var filePath, out _, out _))
{
// TODO: the "/path" is hardcoded, used in ImportStreamCommand and ShaderSourceManager. Find a place to share this correctly.
var pathUrl = storagePath + "/path";
if (FileProvider.FileExists(pathUrl))
{
using var pathStream = FileProvider.OpenStream(pathUrl, VirtualFileMode.Open, VirtualFileAccess.Read);
using var reader = new StreamReader(pathStream);View on GitHub (pinned to 96fad776d2)