Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

fix: ssrRef crashes with nested frozen object #598

Open
@pleinon

Description

@pleinon

🐛 The bug
I am using Apollo Client which returns response data as frozen (Object.freeze()) on development mode. Looks like this causes ssrRef.value mutation to crash when frozen data has nested objects:

'get' on proxy: property 'nested' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#<Object>' but got '[object Object]')

🛠️ To reproduce
Steps to reproduce the behavior:

const crashTest = ssrRef<any | null>(null)
crashTest.value = Object.freeze({
  test: 'works',
  nested: {}, // crash
})

🌈 Expected behaviour
ssrRef should be able to handle frozen complex objects.

ℹ️ Additional context
Sample is greatly simplified from my Pinia-state. Crashing code is executed in store during server side useFetch.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions