Help : Migration from localStorage to Firestore database

Hi everyone,

I finished my app a while ago, fully developed with prototyper.

it worked fine when on localStorage. Then I asked studio prototyper to migrate to the firestore database, and from this time I have problems :

  • not fetching database datas correctly (for some datas it works, for other datas it doesn’t, depending on the page I navigate on)
  • when I create a new db entry (for example I create a new workspace in the app, as superadmin), it logs me out and I am dragged to the login page with url as “/login?error=unauthorized_role”. Yet the entry has been correctly added to Fires
  • I have so many pages with an error “Export getWorkspaces doesn’t exist in target module” (example), as if the whole code hasn’t been adapted during the migration.
  • and many other dependencies failing to load

I am tired it has been days that I’m trying to fix this, and I am turning around with a prototyper that doesn’t really fix the problems, or sometimes it takes too many repetitions.

What should I do before a migration like this so that it goes smoothly ? If I have to do it again, I want to do it the right way…

Thanks to everyone that will help me !

It could be many things. Check your .env.local files of you got the variables correct.
Check your firebase project if firestore is created . If you have images storage bucket should be created. Ask for the prototyper to check the code also…
Without direct access this is first thing that comes to mind.
:victory_hand:

It could also be your Firestore Rules or Firestore permissions. You can manage your FIrestore rules in Firebase Console. You can manage your Firebase permissions for the firebase-sdk connected account on the Google Cloud Platform.