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.

"Invalid JSON from server" even when Push response contains Vaadin-Refresh

See original GitHub issue

Description of the bug

Our Vaadin 22 application is fronted by an SSO solution. When the session has timed out, the login page is returned as HTML when Vaadin performs a request and expects JSON. That login page contains the string Vaadin-Refresh.

In the past this caused Vaadin to refresh the page, but now the following error is shown:

image

As you can see, the string Vaadin-Refresh is still present. But we did upgrade from Vaadin 14 to Vaadin 22 and from Spring Boot 1.5.x to 2.5.x not so long ago.

Expected behavior

No error should be shown and the page should be refreshed instead.

Minimal reproducible example

I don’t know of any other way to reproduce this than to add a reverse proxy in front of a Vaadin application and make it return an HTML page containing Vaadin-Refresh at some point when Vaadin makes an internal request.

Versions

  • Vaadin / Flow version: 22.0.9
  • Java version: 1.8
  • Application Server (if applicable): Spring Boot 2.5.14

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
HermanBovenscommented, Oct 7, 2022

I had a similar problem and I managed to fix it by using a space after the URL to redirect e.g.

As you can see in the screenshot, there is no URL (and there is a space). I tried the regex from the code and it matches this content. But it appears to be a Push response and the regex check is not done in that case.

0reactions
vaadin-botcommented, Oct 28, 2022

This ticket/PR has been released with Vaadin 14.9.0.beta1 and is also targeting the upcoming stable 14.9.0 version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle or change Invalid JSON from Server Vaadin 21
I am trying to display a custom error when there is a session expired or a internal server error using VaadinService.getCurrent().
Read more >
Login page error "Invalid JSON response from server" - Vaadin
Hi, all. I try to create authorization page https://vaadin.com/tutorials/securing-your-app-with-spring-security/setting-up-spring-security LoginForm is show ...
Read more >
How to Fix the Invalid JSON Error in WordPress? - Rank Math
In this article, learn how to fix the invalid JSON error - 'Updating failed. The response is not a valid JSON response.' with...
Read more >
How to Fix the Invalid JSON Error in WordPress? - YouTube
Have you ever tried to upload a file or modify a piece of content on your WordPress site and been greeted by a...
Read more >
Updating failed. The response is not a valid JSON response.
[This thread is closed.] Hello, To improve my SEO I'd change the Permmalink from Plain to Post name but when saving existing posts...
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