Describe the bug
In Solid 2.0.0-beta.14, creating a store from an object with a non-configurable enumerable own property can make Object.keys(store) throw a proxy invariant error.
The source object can be read normally, but enumerating keys through the store proxy fails.
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-x741dmhw?file=src%2FApp.tsx
Minimal repro app:
import { createSignal, createStore } from "solid-js";
const source: any = {};
Object.defineProperty(source, "id", {
value: 1,
enumerable: true,
writable: true,
configurable: false
});
export default function App() {
const [store] = createStore(source);
const [result, setResult] = createSignal("not run");
return (
<main>
<button
onClick={() => {
try {
setResult(`keys: ${Object.keys(store).join(",")} id: ${store.id}`);
} catch (error) {
setResult(String(error));
}
}}
>
read keys
</button>
<p>{result()}</p>
</main>
);
}
Steps to Reproduce the Bug or Issue
- Open the repro.
- Click
read keys.
- Observe the rendered result.
Expected behavior
The store should enumerate the source object's enumerable own property:
keys: id id: 1
### Screenshots or Videos
_No response_
### Platform
- OS: macOS
- Browser: Chrome
- Version: current stable
### Additional context
Actual behavior in the buggy version is a proxy invariant error similar to:
```text
TypeError: 'getOwnPropertyDescriptor' on proxy: trap reported non-configurability for property 'id' ...
This appears related to packages/solid-signals/src/store/store.ts in the store proxy getOwnPropertyDescriptor trap. The trap forwards the source descriptor for non-configurable properties, but the proxy target is the internal store node rather than the original source object, which can violate JavaScript proxy invariants during key enumeration.
Describe the bug
In Solid 2.0.0-beta.14, creating a store from an object with a non-configurable enumerable own property can make
Object.keys(store)throw a proxy invariant error.The source object can be read normally, but enumerating keys through the store proxy fails.
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-x741dmhw?file=src%2FApp.tsx
Minimal repro app:
Steps to Reproduce the Bug or Issue
read keys.Expected behavior
The store should enumerate the source object's enumerable own property:
This appears related to
packages/solid-signals/src/store/store.tsin the store proxygetOwnPropertyDescriptortrap. The trap forwards the source descriptor for non-configurable properties, but the proxy target is the internal store node rather than the original source object, which can violate JavaScript proxy invariants during key enumeration.