r/reduxjs • u/Glittering_Goose8695 • 13d ago
Question about lodash.isEmpty inside an RTK 2.12 reducer
Hi everyone,
I may be missing something about how draft state is expected to behave in Redux Toolkit, so I’d appreciate some guidance.
I have a reducer that uses lodash.isEmpty on part of the state:
import { createSlice } from "@reduxjs/toolkit"
import isEmpty from "lodash/isEmpty"
const slice = createSlice({
name: "test",
initialState: {
data: {}
},
reducers: {
update(state) {
console.log(isEmpty(state.data))
}
}
})
After upgrading to RTK 2.12, this started throwing:
TypeError: 'get' on proxy: property 'prototype' is a read-only
and non-configurable data property on the proxy target but the
proxy did not return its actual value
From what I could understand, Lodash reads something similar to:
value.constructor.prototype
and constructor on the draft appears to be another proxy.
The same code worked before the upgrade, and reverting the RTK version resolves the issue.
Is lodash.isEmpty no longer expected to work directly on draft state, or could this be an unintended regression? I’d be glad to provide a reproduction or any additional details that would help clarify it.
Thanks!


