nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 99 forks source link

Production only firestore SSR error: The "path" argument must be of type string. Received undefined #559

Closed uppergoal closed 3 years ago

uppergoal commented 3 years ago

Version

"@nuxtjs/firebase": "^7.6.1", "firebase": "^8.6.8", "nuxt": "^2.15.3",

Steps to reproduce

  1. Go to: https://www.yezure.dev/
  2. Click the location icon on top menu
  3. Type a city (Montreal has a listing)
  4. Click: SEARCH
  5. You can see a map with listing (in any)
  6. Refresh the page Result: This Serverless Function has crashed.

What is Expected?

The same page loaded client-side should work server-side

What is actually happening?

In my Vercel Realtime Logs, I'm seeing this error

[GET] /search/?lat=45.5016889&lng=-73.567256&label=Montreal,%20QC,%20Canada&country=CA&searchKey=1625018232319
21:59:56:65
2021-06-30T01:59:57.118Z    8df19635-3319-4b1b-9d87-b88cf2ce00f6    ERROR   [2021-06-30T01:59:57.118Z]  @firebase/firestore: Firestore (8.6.8): INTERNAL UNHANDLED ERROR:  TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at Object.resolve (path.js:1039:7)
    at loadProtos (48.js:38813:21)
    at newConnection (48.js:38836:18)
    at OnlineComponentProvider.exports.modules.961.OnlineComponentProvider.createDatastore (48.js:43521:26)
    at OnlineComponentProvider.<anonymous> (48.js:43501:47)
    at step (55.js:145:27)
    at Object.next (55.js:126:57)
    at 55.js:119:75
    at new Promise (<anonymous>)
2021-06-30T01:59:57.136Z    8df19635-3319-4b1b-9d87-b88cf2ce00f6    ERROR   Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError [ERR_INVALID_ARG_TYPE]: The \"path\" argument must be of type string. Received undefined","reason":{"errorType":"TypeError","errorMessage":"The \"path\" argument must be of type string. Received undefined","code":"ERR_INVALID_ARG_TYPE","stack":["TypeError [ERR_INVALID_ARG_TYPE]: The \"path\" argument must be of type string. Received undefined","    at validateString (internal/validators.js:124:11)","    at Object.resolve (path.js:1039:7)","    at loadProtos (48.js:38813:21)","    at newConnection (48.js:38836:18)","    at OnlineComponentProvider.exports.modules.961.OnlineComponentProvider.createDatastore (48.js:43521:26)","    at OnlineComponentProvider.<anonymous> (48.js:43501:47)","    at step (55.js:145:27)","    at Object.next (55.js:126:57)","    at 55.js:119:75","    at new Promise (<anonymous>)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError [ERR_INVALID_ARG_TYPE]: The \"path\" argument must be of type string. Received undefined","    at process.<anonymous> (/var/runtime/index.js:35:15)","    at process.emit (events.js:388:22)","    at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:161:32)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
Unknown application error occurred
uppergoal commented 3 years ago

I was able to resolve my issue via this resolved issue: https://github.com/nuxt-community/firebase-module/issues/125#issuecomment-602651697

*Your firebase plugin must be included in your your dependencies, not devDependencies