Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.
This repository was archived by the owner on May 10, 2021. It is now read-only.

Error enabling offline persistence with Firebase Web SDK and SSR #66

Closed
@zaarheed

Description

@zaarheed

I am trying to use the Google Firebase Web SDK (Firestore, Storage and Analytics) on a Next.js project hosted on Netlify with next-on-netlify.

I have some pages strictly using Firebase Firestore APIs once the page has loaded, and other pages are using Firestore APIs within the getServerSideProps() function. Still inconclusive, but it appears that the pages using Firestore within getServerSideProps are not working. There are two symptoms:

  1. Pages timeout when trying to visit them through a browser, with the following returned:
{"errorMessage":"2020-10-28T23:52:17.325Z 4833e28b-d8c9-47bb-ad04-39d813a0b378 Task timed out after 10.01 seconds"}
  1. If I navigate to the function logs in Netlify, where it appears to have generated a function for the SSR page, the logs are going crazy with the following line printed hundreds of times every minute:
11:51:22 PM: 2020-10-28T23:51:22.407Z	516720dc-661b-4f02-928d-6ca151031376	WARN	Error enabling offline persistence. Falling back to persistence disabled: Error: ENOENT: no such file or directory, open '/src/protos/google/firestore/v1/firestore.proto'

Is there a way around this, or am I doing something wrong?

Everything appears to be working fine on my local machine when I am developing using npm run dev - including SSR. Hence, this might be an issue related to Netlify-Next.js-Firebase.

I found this post on the Netlify community forums which suggests I am not the only one with the issue. But unlike that user, I am not using Netlify lambdas/functions nor am I used the firebase-admin SDK (server-side library). The resolution from this post is also inconclusive, citing: "Note that even though the write succeeded ... the function did not return a 200 and ‘Success!’… or a 500. It returned a 502 with a timeout error at the endpoint"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions