question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Navigation refresh throws JsonReaderException

See original GitHub issue

“Unexpected character encountered while parsing value: e. Path ‘’, line 0, position 0.”

I’m trying to refresh a view. Refreshing with no arguments gives me an empty view, but when passing the proper argument i get a JsonReaderException. The same object is fine when navigating to a new instance of the same view. The OnNavigatedToAsync is not reached before the exeption is thrown. Running on .net core version 5.2.2

var nav = WindowWrapper.Current().NavigationServices.FirstOrDefault();
//Throws exception
nav.Refresh(someObject);
//Works fine
nav.Navigate(typeof(Views.myView), someObject);

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tibitothcommented, Nov 7, 2016

The problem is that the NavigationService.Refresh() method doesn’t serialize the given parameter, but the Navigate() does. https://github.com/Windows-XAML/Template10/blob/master/Template10 (Library)/Services/NavigationService/NavigationService.cs#L340 https://github.com/Windows-XAML/Template10/blob/master/Template10 (Library)/Services/NavigationService/NavigationService.cs#L211

Currently you need to serialize the parameter by hand like this:

NavigationService.Refresh(SerializationService.Json.Serialize(someObject));

I think we need to add serialization into the Refresh() too.

0reactions
JerryNixoncommented, Dec 4, 2016

That being said, I think Refresh(param) is a mistake.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JsonReaderException during JSON deserialization #62427
Description From time to time, I'm encountering the following exception when deserialising on of our JSON files: `---- System.
Read more >
Navigation in React Native doesn't work after page refresh
When I just start the app, I can navigate from one page to another without any problem. But when I refresh any page,...
Read more >
PropertyList serialization error after upgrade to CMS 12
Hi. We have a bunch of propertylists in our project, all of which started throwing serialization errors post upgrade to CMS 12.
Read more >
NavigationService.Refresh Method (System.Windows. ...
To force NavigationService to re-navigate to the content, call Refresh. ... by calling Navigate or Refresh, a new entry is not added to...
Read more >
Bugs & Issues v4.3.X #1126 | Support Center | ABP Commercial
To update your version to v4.3.x for both ABP CLI and ABP Suite run the following ... ReThrowWithPath(ReadStack& state, JsonReaderException ex) at System....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found