Closed hide212131 closed 1 year ago
The AxiosHeaders
is a class, which is why it's non-serializable.
Do Not Put Non-Serializable Values in State or Actions
Avoid putting non-serializable values such as Promises, Symbols, Maps/Sets, functions, or class instances into the Redux store state or dispatched actions.
The solution seems to be adding 'headers' to the already existing ignoredActionPaths .
I'll submit a PR.
A non-serializable value was detected in an action, in the path: payload
. Value: AxiosError {message: 'Request failed with status code 500', name: 'AxiosError', code: 'ERR_BAD_RESPONSE', config: {…}, request: XMLHttpRequest, …}
Take a look at the logic that dispatched this action: {type: 'auth/alreadyUser/fulfilled', payload: AxiosError, meta: {…}}
(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)
(To allow non-serializable values see)
how to solve this error ?
Overview of the issue
In a React app using Redux Toolkit, a browser error stating 'A non-serializable value was detected' appears during server calls made with Axios.
This issue consistently occurs when a 'fulfilled' action, such as 'authentication/get_account/fulfilled', is dispatched in Redux.
Motivation for or Use Case
While this is not resulting in direct malfunction, it does cause confusion for the developer.
Reproduce the error
Start React app.
Related issues
22483
Suggest a Fix
Under investigation
JHipster Version(s)
JHipster configuration
.yo-rc.json file
Environment and Tools
openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7) OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)
git version 2.39.2 (Apple Git-143)
node: v18.14.2 npm: 9.5.0
Docker version 23.0.5, build bc4487a
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System