{"record":{"id":"e5032816ec71b4b3","repo":"stride3d/stride","slug":"failed-to-compile-url","errorCode":null,"errorMessage":"Failed to compile { Url }.","messagePattern":"Failed to compile (.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Physics/HeightmapAssetCompiler.cs","lineNumber":261,"sourceCode":"                                        ScaleToHeightRange(bytes, byte.MinValue, byte.MaxValue, heightRange, heightScale, commandContext);\n                                    }\n\n                                    heightmap = Heightmap.Create(size, heightType, heightRange, heightScale, bytes);\n                                }\n                                break;\n\n                            default:\n                                throw new Exception($\"{ heightType } height type is not supported.\");\n                        }\n\n                        commandContext.Logger.Info($\"[{Url}] Convert Image(Format={ texImage.Format }, Width={ texImage.Width }, Height={ texImage.Height }) \" +\n                            $\"to Heightmap(HeightType={ heightType }, MinHeight={ heightRange.X }, MaxHeight={ heightRange.Y }, HeightScale={ heightScale }, Size={ size }).\");\n                    }\n                }\n\n                if (heightmap == null)\n                {\n                    throw new Exception($\"Failed to compile { Url }.\");\n                }\n\n                assetManager.Save(Url, heightmap);\n\n                return Task.FromResult(ResultStatus.Successful);\n            }\n\n            private void CalculateByteOrShortRange(Vector2 heightRage, float heightScale, out float min, out float max)\n            {\n                var minHeight = heightRage.X;\n                var maxHeight = heightRage.Y;\n\n                min = MathF.Round((minHeight / heightScale), MidpointRounding.AwayFromZero);\n                max = MathF.Round((maxHeight / heightScale), MidpointRounding.AwayFromZero);\n\n                if (heightScale < 0)\n                {\n                    min = (min * heightScale) < minHeight ? min - 1 : min;","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Physics/HeightmapAssetCompiler.cs#L243-L279","documentation":"This is a final safety check: after all format conversion and height-type branches, if no Heightmap instance was produced the compiler throws 'Failed to compile {Url}'. It signals the heightmap asset pipeline produced nothing, usually because an earlier branch silently skipped creation or the texture had zero/invalid dimensions.","triggerScenarios":"DoCommandOverride completes every switch without assigning the local heightmap (e.g. unhandled combination of height type and pixel layout, or empty texture data), then the null check fires before assetManager.Save.","commonSituations":"Assets with mismatched configuration (unsupported format caught earlier but heightmap still null), zero-sized source images, or partially migrated assets from an older project.","solutions":["Check build logs above this error for the format/height-type that failed to convert","Fix the source image format and re-import (see the unsupported-format error)","Re-create the heightmap asset from a valid 8-bit RGBA grayscale image","Verify the texture has non-zero width/height"],"exampleFix":"// before\nvar img = Image.Load(\"empty.png\"); // 0x0 image\n// after\nvar img = Image.Load(\"terrain_1024x1024_rgba8.png\");","handlingStrategy":"validation","validationCode":"using var img = Image.Load(path);\nif (img.PixelBuffer.Width == 0 || img.PixelBuffer.Height == 0)\n    throw new InvalidOperationException($\"Heightmap source {path} has zero dimensions\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fix any earlier unsupported-format warnings — they cascade into a null heightmap","Verify source images are non-empty and readable","Check verbose build logs for the branch that skipped heightmap creation","Keep asset configurations consistent with supported format/type combinations"],"tags":["physics","heightmap","asset-compilation"],"backgroundTag":"asset-compilation-failed","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}