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 enabling offline persistence #557

Open
adarsh4d opened this issue Jun 28, 2021 · 2 comments
Open

Error enabling offline persistence #557

adarsh4d opened this issue Jun 28, 2021 · 2 comments

Comments

@adarsh4d
Copy link

adarsh4d commented Jun 28, 2021

I am using asyncData to fetch doc from firebase, it works perfectly on development, but when I try to host it on Vercel with ssr: true, I am getting the following error

dd4-ef8f-410a-853f-4e69a617036c WARN Error enabling offline persistence. Falling back to persistence disabled: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

I tried disabling the auth persistence, but the error is still there

Version

@nuxtjs/firebase: 6.1.1
firebase: 7.22.1
nuxt: 2.14.5

nuxt.config.js

firebase: {
    config: {
      apiKey: private,
      authDomain: private,
      projectId: private,
      storageBucket: private,
      messagingSenderId: private,
      appId: private,
      measurementId: private,
    },
    services: {
      auth: {
        persistence: 'none',
        initialize: { onAuthStateChangedAction: 'user/initializeData' },
        ssr: true,
      },
      firestore: {
        enablePersistence: false,
      },
      functions: { location: private },
      storage: true,
    },
  }

What is Expected?

The page should load with the correct data

What is actually happening?

The function timeout with the above-mentioned error

Any help would be much appreciated!! Thank you

@simeon9696
Copy link

I don't think you can enable offline persistence on SSR because you'd be trying to persist data on the server, not the client

@adarsh4d
Copy link
Author

adarsh4d commented Jul 1, 2021

Yeah understood, I am not trying to enable it. As you can see in my config above, I have set it to false on both firestore and auth, and still getting this error.

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

2 participants