zod icon indicating copy to clipboard operation
zod copied to clipboard

parsed data is becoming never

Open AmruthjithSunil opened this issue 5 months ago • 10 comments

image(1) const parsedData = getSuggestionsSchema.safeParse( action.payload?.data, ); if (!parsedData.data) { console.error("getSuggestions", parsedData.error); state.suggestions = initialState.suggestions; state.userMessage = initialState.userMessage; return; } const parsedError = parsedData.error; parsedError && console.warn(parsedError); parsedData.error && console.error(parsedData.error);

only in the last line inside the console error. Im getting error "Property 'error' does not exist on type 'never'"

AmruthjithSunil avatar Sep 06 '24 12:09 AmruthjithSunil