Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Error: Failed to write value.Error Domain=NSCocoaErrorDomain Code=4 #415

Open
rusakovic opened this issue Dec 21, 2024 · 0 comments
Open

Comments

@rusakovic
Copy link

System: iOS 18, real iphone 14 pro device.

Packages

"expo": "~51.0.28",
"@supabase-cache-helpers/postgrest-react-query": "1.11.4",
"@supabase/supabase-js": "2.47.10",
"@legendapp/state": "3.0.0-beta.19",

Error

 ERROR  Error: Failed to write value.Error Domain=NSCocoaErrorDomain Code=4 "The folder “c3c237b54737e9cde04ea2928fa6ef23” doesn’t exist."

How to reproduce:

  1. Run the app once
  2. Remove pods folder
  3. Rebuild the app from scratch

Expected behavior:
If the folder doesn't exist - create a new folder in async storage.

Setup was taken from https://supabase.com/blog/local-first-expo-legend-state

import { createClient } from '@supabase/supabase-js'
import { observable } from '@legendapp/state'
import { syncedSupabase } from '@legendapp/state/sync-plugins/supabase'
import { configureSynced } from '@legendapp/state/sync'
import { observablePersistAsyncStorage } from '@legendapp/state/persist-plugins/async-storage'
import AsyncStorage from '@react-native-async-storage/async-storage'

const supabase = createClient(
 process.env.EXPO_PUBLIC_SUPABASE_URL,
 process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY
)

// Create a configured sync function
const customSynced = configureSynced(syncedSupabase, {
 // Use React Native Async Storage
 persist: {
   plugin: observablePersistAsyncStorage({
     AsyncStorage,
   }),
 },
 generateId,
 supabase,
 changesSince: 'last-sync',
 fieldCreatedAt: 'created_at',
 fieldUpdatedAt: 'updated_at',
 // Optionally enable soft deletes
 fieldDeleted: 'deleted',
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant