muon icon indicating copy to clipboard operation
muon copied to clipboard

React app just shows white screen

Open abemedia opened this issue 5 years ago • 1 comments

I have a react app built with CRA which works fine in the browser but only displays a white screen here. I added some static HTML to the index file and that works without an issue so it appears its just having issues running the react app.

The react app works fine in Chrome/FF/WebkitGtk (using https://github.com/zserge/webview) so my feeling is that it's something that isn't implemented in Ultralight but without seeing the console output its hard to say.

Is there any way we can get the console output from Ultralight? Like a debug flag or something?

abemedia avatar Apr 29 '20 02:04 abemedia

What I did was manually edit muon.go to add

func loggingCallback() func(user_data unsafe.Pointer, caller ULView, source ULMessageSource, level ULMessageLevel, message ULString, line_number uint32, column_number uint32, source_id ULString) {
	return func(user_data unsafe.Pointer, caller ULView, source ULMessageSource, level ULMessageLevel, message ULString, line_number uint32, column_number uint32, source_id ULString) {
		s := unsafe.Pointer(UlStringGetData(message))
		sz := UlStringGetLength(message)
		wstr := (*[256]uint16)(s)[:sz:sz]

		out := utf16.Decode(wstr)
		fmt.Println(string(out))
	}
}

and then in (window*) Start() on line 107 I added UlViewSetAddConsoleMessageCallback(w.view, loggingCallback(), nil)

Tarinaky avatar Sep 27 '22 09:09 Tarinaky