Neutronium: 'One or more errors occurred' on updating View Model properties

I am developing a data editor but I am having exceptions on updating the view model:

DataContentCreator.exe Error: 0 : Neutronium - Error: WebView crashed trying recover
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/index.html
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/css/app.css
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/js/app.js
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/js/chunk-vendors.js
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/css/chunk-vendors.css
The thread 0x3a00 has exited with code 0 (0x0).
DataContentCreator.exe Information: 0 : Neutronium - Info: Exception encountered during task dispatch: Chromium.CfxRemotingException: Remote connection lost. ---> System.IO.EndOfStreamException: Unexpected end of stream.
   at Chromium.Remote.StreamHandler.FillReadBuffer(Int32 count)
   at Chromium.Remote.RemoteConnection.ReadLoop()
   at Chromium.Remote.RemoteConnection.ReadLoopEntry()
   --- End of inner exception stack trace ---
   at Chromium.Remote.RemoteCall.RequestExecution(RemoteConnection connection)
   at Chromium.Remote.CfrV8Value.CreateUndefined()
   at Neutronium.WebBrowserEngine.ChromiumFx.V8Object.ChromiumFXJavascriptRoot.Invoke(String functionName, IWebView context, IJavascriptObject[] parameters)
   at Neutronium.JavascriptFramework.Vue.VueJavascriptSessionInjector.RegisterMainViewModel(IJavascriptObject jsObject)
   at Neutronium.Core.Binding.BidirectionalMapper.RegisterMain(IJavascriptObject res)
   at Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxDispatcher.<>c__DisplayClass15_0`1.<ToTaskAction>g__Result|0()
DataContentCreator.exe Information: 0 : Neutronium - Info: Problem in exiting chromiumFx context : Chromium.CfxRemotingException: Remote connection lost. ---> System.IO.EndOfStreamException: Unexpected end of stream.
   at Chromium.Remote.StreamHandler.FillReadBuffer(Int32 count)
   at Chromium.Remote.RemoteConnection.ReadLoop()
   at Chromium.Remote.RemoteConnection.ReadLoopEntry()
   --- End of inner exception stack trace ---
   at Chromium.Remote.RemoteCall.RequestExecution(RemoteConnection connection)
   at Chromium.Remote.CfrV8Context.Exit()
   at Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxDispatcher.ChromiumFxContext.Dispose()
Neutronium - Browser Log: Message: Neutronium: ViewModel injected, source: , line number: 8699, page: https://application/View/dist/index.html#/main
An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll
One or more errors occurred.

My cjson looks like this when I have yet to load a file to edit (this based from the Neutronium SPA Template, nothing much has been changed):

{
    "ViewModel": {
        "ApplicationInformation": {
            "MadeBy": "Nohj",
            "Name": "Data Content Creator",
            "Version": "1.0.0.0",
            "Year": 2019
        },
        "CurrentViewModel": {},
        "Editor": {
            "CurrentlySelectedTreeItem": null,
            "Session": null,
            "SingleItemCollection": null
        },
        "Modal": null,
        "Notification": null,
        "Router": {
            "AfterResolveCommand": "cmd(true)",
            "BeforeResolveCommand": "cmd(true)",
            "Route": "main"
        },
        "Window": {
            "Close": "cmd(true)",
            "Maximize": "cmd(true)",
            "Minimize": "cmd(true)",
            "Normalize": "cmd(true)",
            "State": {
                "type": "WindowState",
                "intValue": 0,
                "name": "Normal",
                "displayName": "Normal"
            }
        }
    },
    "Window": {
        "CloseReady": "cmd(true)",
        "EndOpen": "cmd(true)",
        "IsListeningClose": false,
        "IsListeningOpen": false,
        "State": {
            "type": "WindowLogicalState",
            "intValue": 1,
            "name": "Opened",
            "displayName": "Opened"
        }
    },
    "version": 1
}

I am trying to update the properties on this part, specifically the ‘Session’ part:

"Editor": {
            "CurrentlySelectedTreeItem": null,
            "Session": null,
            "SingleItemCollection": null
        },

but then that error occurs. How I update them looks like this. (the SetValue are my helpers, they do the INotifyPropertyChanged upon setting)

public SessionViewModel Session
        {
            get => _session;
            set
            {
                if(SetValue(ref _session, value))
                    SingleItemCollection = new ObservableCollection<SessionViewModel> { _session };
            }
        }

        public ObservableCollection<SessionViewModel> SingleItemCollection
        {
            get => _singleItemCollection;
            set => SetValue(ref _singleItemCollection, value);
        }

        public object CurrentlySelectedTreeItem
        {
            get => _currentlySelectedTreeItem;
            set => SetValue(ref _currentlySelectedTreeItem, value);
        }

I tried disposing the HTMLViewControl before updating then re instantiating and setting the properties like how it ought to be as it was on initialization but then a somewhat same error occurs

           HTMLViewCtrl.Dispose();
           HTMLViewCtrlContainer.Children.Remove(HTMLViewCtrl);

            /*  Instantiates */
            ViewModel.Session = new SessionViewModel(data);

            Dispatcher.DispatchOnContextIdle(() =>
            {
                HTMLViewCtrl = new HTMLViewControl();
                HTMLViewCtrlContainer.Children.Add(HTMLViewCtrl);

                Dispatcher.DispatchAfterRender(() =>
                {
                    HTMLViewCtrlContainer.InvalidateVisual();

                    HTMLViewCtrl.Uri = SetUp.Uri;
                    HTMLViewCtrl.DebugCommands = SetUp.DebugCommands;
                    HTMLViewCtrl.IsDebug = SetUp.Debug;
                });
            });
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/index.html
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/css/app.css
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/js/app.js
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/js/chunk-vendors.js
DataContentCreator.exe Information: 0 : Neutronium - Info: Loaded: /View/dist/css/chunk-vendors.css
The thread 0x326c has exited with code 0 (0x0).
DataContentCreator.exe Information: 0 : Neutronium - Info: Exception encountered during task dispatch: Chromium.CfxRemotingException: Remote connection lost. ---> System.IO.EndOfStreamException: Unexpected end of stream.
   at Chromium.Remote.StreamHandler.FillReadBuffer(Int32 count)
   at Chromium.Remote.RemoteConnection.ReadLoop()
   at Chromium.Remote.RemoteConnection.ReadLoopEntry()
   --- End of inner exception stack trace ---
   at Chromium.Remote.RemoteCall.RequestExecution(RemoteConnection connection)
   at Chromium.Remote.CfrV8Value.CreateUndefined()
   at Neutronium.WebBrowserEngine.ChromiumFx.V8Object.ChromiumFXJavascriptRoot.Invoke(String functionName, IWebView context, IJavascriptObject[] parameters)
   at Neutronium.JavascriptFramework.Vue.VueJavascriptSessionInjector.RegisterMainViewModel(IJavascriptObject jsObject)
   at Neutronium.Core.Binding.BidirectionalMapper.RegisterMain(IJavascriptObject res)
   at Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxDispatcher.<>c__DisplayClass15_0`1.<ToTaskAction>g__Result|0()
DataContentCreator.exe Information: 0 : Neutronium - Info: Exception encountered during task dispatch: Chromium.CfxRemotingException: Remote connection lost. ---> System.IO.EndOfStreamException: Unexpected end of stream.
   at Chromium.Remote.StreamHandler.FillReadBuffer(Int32 count)
   at Chromium.Remote.RemoteConnection.ReadLoop()
   at Chromium.Remote.RemoteConnection.ReadLoopEntry()
   --- End of inner exception stack trace ---
   at Chromium.Remote.RemoteCall.RequestExecution(RemoteConnection connection)
   at Chromium.Remote.CfrV8Value.CreateInt(Int32 value)
   at Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxFactory.CreateObjects(ObjectsCreationOption option)
   at Neutronium.Core.Binding.Builder.JavascriptObjectBulkBuilder.BulkCreateObjects()
   at Neutronium.Core.Binding.Builder.JavascriptObjectBulkBuilder.CreateObjects()
   at Neutronium.Core.Binding.Builder.JavascriptObjectBulkBuilder.UpdateJavascriptValue()
   at Neutronium.Core.Binding.Updaters.JsUpdateHelper.UpdateOnJavascriptContext(BridgeUpdater updater, IJsCsGlue value)
   at Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxDispatcher.CfrTask_Execute(Object sender, CfrEventArgs e)
DataContentCreator.exe Information: 0 : An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll
One or more errors occurred.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

I think I have an idea on why the error is happening. It’s probably with the data types or the objects within the Session object being loaded. Since when I added Bindable(false) to all the properties that I did not need, it crashed no more.

I’m going to try to pinpoint which property/data_type was making the app crash to help improving the Neutronium