You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using SPA mode, pages that do not load any data fail to render correctly. In my case, the start page had no data and was not working, while all other pages that contained data loaded as expected.
Error Message
The following error is thrown in the console:
Error in client-side routing Object { error: SyntaxError, event: {…}, status: 500, message: "Internal Error" }error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON dataevent: Object { params: {}, url: URL, route: {…} }message: "Internal Error"status: 500<prototype>: Object { … }
Expected Behavior
Pages without explicit data queries should still render correctly instead of causing a client-side error.
Workaround
Adding a simple query or referencing data in a component fixes the issue. For example, including the following query in the page makes it work:
last_update
SELECT
date
FROM
table
ORDER BY date DESC
LIMIT 1;
Last update: <Valuedata={last_update} />.
Possible Cause
It seems that when there is no data available, the app still expects a JSON response, but instead, it either gets an empty response or an invalid format. This could indicate a missing fallback mechanism in JSON parsing.
Steps to Reproduce
Build evidence app in SPA mode
Serve with `serve build --single
Go to page without data
Logs
Error in client-side routing
Object { error: SyntaxError, event: {…}, status: 500, message: "Internal Error" }
error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
event: Object { params: {}, url: URL, route: {…} }
message: "Internal Error"
status: 500
<prototype>: Object { … }
Describe the bug
When using SPA mode, pages that do not load any data fail to render correctly. In my case, the start page had no data and was not working, while all other pages that contained data loaded as expected.
Error Message
The following error is thrown in the console:
Expected Behavior
Pages without explicit data queries should still render correctly instead of causing a client-side error.
Workaround
Adding a simple query or referencing data in a component fixes the issue. For example, including the following query in the page makes it work:
Possible Cause
It seems that when there is no data available, the app still expects a JSON response, but instead, it either gets an empty response or an invalid format. This could indicate a missing fallback mechanism in JSON parsing.
Steps to Reproduce
Logs
System Info
Severity
annoyance
Additional Information, or Workarounds
No response
The text was updated successfully, but these errors were encountered: