{"record":{"id":"642d8c177b6f4609","repo":"wailsapp/wails","slug":"sizeofresource-failed","errorCode":null,"errorMessage":"SizeofResource failed","messagePattern":"SizeofResource failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/pkg/w32/kernel32.go","lineNumber":181,"sourceCode":"\tret, _, _ := procFindResource.Call(\n\t\tuintptr(hModule),\n\t\tuintptr(unsafe.Pointer(lpName)),\n\t\tuintptr(unsafe.Pointer(lpType)))\n\n\tif ret == 0 {\n\t\treturn 0, syscall.GetLastError()\n\t}\n\n\treturn HRSRC(ret), nil\n}\n\nfunc SizeofResource(hModule HMODULE, hResInfo HRSRC) uint32 {\n\tret, _, _ := procSizeofResource.Call(\n\t\tuintptr(hModule),\n\t\tuintptr(hResInfo))\n\n\tif ret == 0 {\n\t\tpanic(\"SizeofResource failed\")\n\t}\n\n\treturn uint32(ret)\n}\n\nfunc LockResource(hResData HGLOBAL) unsafe.Pointer {\n\tret, _, _ := procLockResource.Call(uintptr(hResData))\n\n\tif ret == 0 {\n\t\tpanic(\"LockResource failed\")\n\t}\n\n\treturn unsafe.Pointer(ret)\n}\n\nfunc LoadResource(hModule HMODULE, hResInfo HRSRC) HGLOBAL {\n\tret, _, _ := procLoadResource.Call(\n\t\tuintptr(hModule),","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/wailsapp/wails/blob/0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3/v3/pkg/w32/kernel32.go#L163-L199","documentation":"Error \"SizeofResource failed\" thrown in wailsapp/wails.","triggerScenarios":"Occurs when SizeofResource returns 0, e.g. the resource handle is invalid or the resource was not found in the module.","commonSituations":"See trigger scenarios.","solutions":["Pass the correct module handle (from LoadLibrary/GetModuleHandle) and a valid HRSRC returned by FindResource; SizeofResource fails when the resource does not exist.","Verify the resource is compiled into the executable (check the .rc file / rsrc section) and the resource name and type match exactly."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3","analyzedAt":"2026-08-15T14:17:36.034Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}