Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

FetchAll() throwing : TypeError: Cannot assign to read-only property '_bitField' #382

Open
NabeelUppel opened this issue Mar 23, 2023 · 0 comments

Comments

@NabeelUppel
Copy link

I'm trying to get all subreddits that a user is subscribed to and I keep getting an error.

async function getAllSubscriptions() {
  try {
    const r = createSnoowrapRequester();
    r.config({ debug: true })
    let s = await r.getSubscriptions({ limit: 1 })
    //this works
    console.log(s.length);
   //this doesn't work
    let all = await s.fetchAll({ append: true });
    console.log(all.length);
  } catch (error) {
    console.log(error);
  }
}
TypeError: Cannot assign to read-only property '_bitField'

I tried FetchMore() and it works up to a certain amount. 100 works but 110 failed with the same error.

async function getAllSubscriptions() {
  try {
    const r = createSnoowrapRequester();
    r.config({ debug: true })
    let s = await r.getSubscriptions({ limit: 1 })
     //this works
    console.log(s.length);
    let all = await s.fetchMore({ amount: 100, append: true });
     //this doesn't works
    console.log(all.length);
  } catch (error) {
    console.log(error);
  }
}

I am using Expo Managed React Native.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant