Giter VIP home page Giter VIP logo

Comments (15)

schmidt-sebastian avatar schmidt-sebastian commented on May 30, 2024

@udox-cameron Do you know if your Firestore document may contain an empty array?

If you can reproduce this, do you mind grabbing the contents of the event object via JSON.stringify(event)? Thanks.

And just to verify, the Firestore dependency you are using is 0.10.x? If you have a package-lock.json or yarn.lock, you might see an older version.

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

@schmidt-sebastian I am getting the exact same error. The document that triggers the function that fails with the error looks as follows:

{
  "attachments": [
    
  ],
  "author": {
    "email": "x@y",
    "fullName": "z",
    "jobTitle": "w"
  },
  "content": {
    "html": "<p>Simple post content<\/p>\n",
    "htmlEscaped": "&lt;p&gt;Simple post content&lt;\/p&gt;\n",
    "markdown": "Simple post content",
    "plaintext": "Simple post content"
  },
  "createdAt": "2018-01-12T14:53:27.097Z",
  "draft": false,
  "draftLabels": {
    "lR7KSMZPgznVJRsd8F0z": 1515768805616
  },
  "excerpt": "Simple post content",
  "forwardToWebhooks": false,
  "labels": {
    "lR7KSMZPgznVJRsd8F0z": true
  },
  "orderedLabels": [
    "lR7KSMZPgznVJRsd8F0z"
  ],
  "publicationTime": "2018-01-12T14:53:00.001Z",
  "slug": "my-title",
  "title": "My title",
  "tstate": false,
  "updatedAt": "2018-01-12T14:53:34.180Z"
}

Firestore version used is 0.10.1.

from nodejs-firestore.

schmidt-sebastian avatar schmidt-sebastian commented on May 30, 2024

I was just able to reproduce this. It looks like for empty arrays, ProtobufJS doesn't always return the array type. Thanks for your patience.

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

@schmidt-sebastian Great! Do you have a rough idea of the time it will take to see a public release that fixes the issue?

from nodejs-firestore.

udox-cameron avatar udox-cameron commented on May 30, 2024

Hey,

I can't print out the error because I just get the error above. Here is the data it is working with.

{ "beaconfunctionsgroups":[], beacons":["2fUU4F8"], "campaign":"POS", "gid":"orgkey", "status":"updated", "url":"http://bfred-it.github.io/iphone-inline-video/demo/threejs.html", "visibleTime":"2018-01-12T13:49:00.000Z" }

from nodejs-firestore.

schmidt-sebastian avatar schmidt-sebastian commented on May 30, 2024

The releases for 0.10.2 and 0.11.1 contain fixes for this issue. Note that the cache on Google Cloud Functions currently still resolves firebase-admin's Firestore dependency to 0.10.1. I will notify this thread when that is no longer the case.

from nodejs-firestore.

schmidt-sebastian avatar schmidt-sebastian commented on May 30, 2024

If you redeploy your Functions, you should now be able to get the newest copy from the cache and no longer see this error.

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

@schmidt-sebastian Erf, I have updated the dependencies as follows:

    "firebase-admin": "5.6.0",
    "firebase-functions": "^0.8.0",

It seems that GRPC 1.8.0 is fetched. As a consequence, a lot of functions fail with the famous Error: Stream removed :(

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

@schmidt-sebastian Reverting to firebase-admin 5.5.1 and firebase-functions 0.7.5 still fetches the new dependency! Is there a way to force the old dependency so that GRPC is not fetched? that's a big issue since it breaks all our functions at this time.

from nodejs-firestore.

schmidt-sebastian avatar schmidt-sebastian commented on May 30, 2024

Do you see this locally or on functions?

These are the results I get:

functions $ rm package-lock.json 

functions $ rm -rf node_modules/

functions $ npm install --save [email protected]

> [email protected] install /Users/mrschmidt/Desktop/node-review-with-fix/functions/node_modules/google-gax/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/Users/mrschmidt/Desktop/node-review-with-fix/functions/node_modules/google-gax/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node" is installed via remote

> [email protected] install /Users/mrschmidt/Desktop/node-review-with-fix/functions/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/Users/mrschmidt/Desktop/node-review-with-fix/functions/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64/grpc_node.node" is installed via remote

> [email protected] postinstall /Users/mrschmidt/Desktop/node-review-with-fix/functions/node_modules/google-gax/node_modules/protobufjs
> node scripts/postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.
+ [email protected]
added 435 packages in 18.378s

functions $ npm install --save firebase-functions@^0.8.0
+ [email protected]
added 57 packages in 5.373s

functions $ npm list | grep grpc
│ │ ├─┬ @google-cloud/[email protected]
│ │ │ ├── [email protected] deduped
│ │ │ ├─┬ [email protected]
│ │ ├─┬ [email protected]

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

@schmidt-sebastian Ah sorry, the issue seems due to firebase 4.8.2 that is also used in my setup:

├─┬ [email protected]
│ ├─┬ @firebase/[email protected]
│ │ ├── @firebase/[email protected]
│ │ └── @firebase/[email protected]
│ ├─┬ @firebase/[email protected]
│ │ └── @firebase/[email protected]
│ ├─┬ @firebase/[email protected]
│ │ ├── @firebase/[email protected]
│ │ └── [email protected]
│ ├─┬ @firebase/[email protected]
│ │ ├── @firebase/[email protected]
│ │ ├── @firebase/[email protected]
│ │ └─┬ [email protected]

I will try to downgrade to an older version. Do you know a compatible one?

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

The dependency tree is from my local setup. The error is with deployed functions :S

from nodejs-firestore.

lpellegr avatar lpellegr commented on May 30, 2024

Using firebase 4.6.1 is fetching a compatible version of GRPC.

@schmidt-sebastian Do you think it's worth opening an issue on firebase-js-sdk?

from nodejs-firestore.

schmidt-sebastian avatar schmidt-sebastian commented on May 30, 2024

@schmidt-sebastian Do you think it's worth opening an issue on firebase-js-sdk?

I will get this resolved internally.

from nodejs-firestore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.