kikipoulet / SukiUI

UI Theme for AvaloniaUI
MIT License
1.5k stars 139 forks source link

[Bug] AOT problem: 1. Program will crash if use SukiSideMenu. 2. Program will crash if use SukiWindow when run in win7. #308

Open telesa864 opened 1 month ago

telesa864 commented 1 month ago

Check the following items

Description of the issue

AOT is success, but run with crash.

  1. Program will crash if use SukiSideMenu.
  2. Program will crash if use SukiWindow when run in win7.

Package Version

6.0.0.-beta8

Environment

win7 or win11

Expected Behavior

.

Reproduction

.

Additional Information

No response

kikipoulet commented 1 month ago

What code ? The SukiDemo project doesn't work with AOT because of using a ViewLocator.

telesa864 commented 1 month ago

What code ? The SukiDemo project doesn't work with AOT because of using a ViewLocator.

My test project without ViewLocator. It works fine in AOT without SukiSideMenu. 屏幕截图 2024-10-14 164034

telesa864 commented 1 month ago

By the way, when the window is maximized, the icon is not centered when side menu is collapsed . 屏幕截图 2024-10-14 164828

AlexStanglEmerson commented 3 weeks ago

I think I may have run into a similar issue. When upgrading from -beta4 to -beta8 or -rc, the WASM build no longer works in release mode (debug mode works). The desktop build works fine, but it isn't using NativeAOT. My application uses the SukiSideMenu element as well.

Unfortunately the WASM build doesn't provide a ton of information other than an invalid cast was attempted.

image

invoke_method_and_handle_exception (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/invoke-cs.ts#277)
bound_fn (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/invoke-cs.ts#247)
constructor (https://localhost:5000/webapp/modules/avalonia/rendering/canvasSurface.ts#16)
onResize (https://localhost:5000/webapp/modules/avalonia/rendering/resizeHandler.ts#55)
observeSize (https://localhost:5000/webapp/modules/avalonia/rendering/resizeHandler.ts#10)
constructor (https://localhost:5000/webapp/modules/avalonia/rendering/canvasSurface.ts#13)
create (https://localhost:5000/webapp/modules/avalonia/rendering/canvasSurface.ts#42)
bound_fn (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/invoke-js.ts#233)
mono_wasm_invoke_import (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/invoke-js.ts#276)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#0)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4962467)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4947157)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4894279)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4951849)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#5668388)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#5498935)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#5501252)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#5511165)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#6944448)
_mono_wasm_invoke_method_bound (https://localhost:5000/dotnet.native.js#8)
invoke_method_and_handle_exception (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/invoke-cs.ts#273)
complete_task (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/managed-exports.ts#142)
_marshal_task_to_cs (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/marshal-to-cs.ts#335)
_marshal_task_to_cs (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/marshal-to-cs.ts#329)
bind_arg_marshal_to_cs (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/marshal-to-cs.ts#83)
bound_fn_2R (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/invoke-js.ts#202)
mono_wasm_invoke_import (https://raw.githubusercontent.com/dotnet/runtime/81cabf2857a01351e5ab578947c7403a5b128ad1/src/mono/wasm/runtime/invoke-js.ts#276)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#0)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4962467)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4947157)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4894279)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#4951849)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#5668388)
<anonymous> (wasm:https://localhost:5000/dotnet.runtime.js%20line%203%20%3E%20WebAssembly.Module#5498935)