-
Notifications
You must be signed in to change notification settings - Fork 943
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
Firebase Emulator Error: Channel credentials must be a ChannelCredentials object #2207
Comments
@Pitouli could you show me the dependencies in your |
Sure! Interesting point: I clone my last commit (which I'm 100% sure it worked well) and started to reintegrate one by one my modifications. Currently, I'm at a point where all the src files in the functions directory of my copy project are identical to those of the cloned project, and I have the bug in the cloned but not in the copy :/ I continue to explore what could be the source of the issue.
|
Ok, since it was working on my duplicated project, I decided to remove all the nodes_modules from my main one and reinstall them fresh. Now, it works. I do not understand why this error happened, but since it's a dev tool, I would say that it is not so important if the error is rare and the solution easy. So I close this issue. |
@Pitouli glad you fixed it! This error can happen when you have multiple versions of gRPC libraries in your node_modules. gRPC has a C++ implementation and sometimes passing objects (like Credentials) between versions does not work. The good news is that almost all of Google's Node.js libraries have moved to |
Sorry @samtstern I am still having this issue. I remove all node_modules and installing all of them again. Project structure: .
└── functions
├── packages
│ └── core
│ ├── controllers
│ ├── services
│ └── tests
│ ├── controllers
│ └── services
├── companies
│ ├── api
│ │ └── controllers
│ │ └── v1
│ │ ├── authentication
│ │ ├── healthcheck
│ │ ├── image
│ │ └── roles
│ ├── providers
│ ├── services
│ ├── services-config
│ └── tests
│ ├── api
│ │ └── controllers
│ │ └── v1
│ │ ├── authentication
│ │ └── roles
│ ├── fixtures
│ └── services
├── test
└── user-management
├── controllers
│ └── v1
├── providers
├── services
├── services-config
└── tests
├── controllers
│ └── v1
└── services This is my package.json of the functions that triggers the error. {
"name": "user-management",
"version": "1.0.0",
"description": "User Management,
"scripts": {
"generate:keys:dev": "cp services-config/app.prod.json services-config/app.json",
"generate:keys:test": "cp services-config/app.test.json services-config/app.json",
"dev": "npm run generate:keys:dev && nodemon index.js",
"start": "npm run generate:keys:dev && node index.js",
"test": "npm run generate:keys:test && nyc --reporter=lcov ava",
"watch:test": "ava --watch",
"lint": "npx eslint ."
},
"repository": {
"type": "git",
"url": ""
},
"engines": {
"node": "10"
},
"private": true,
"devDependencies": {
"@ava/babel": "^1.0.1",
"ava": "^3.6.0",
"eslint": "^6.8.0",
"eslint-plugin-promise": "^4.2.1",
"husky": "^4.2.5",
"mock-req-res": "^1.1.4",
"nodemon": "^2.0.3",
"nyc": "^15.0.1",
"proxyquire": "^2.1.3",
"sinon": "^9.0.2"
},
"dependencies": {
"@company/core": "file:../packages/core",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"express-multipart-file-parser": "^0.1.2",
"firebase": "^7.14.0",
"firebase-admin": "^8.10.0",
"json2csv": "^5.0.0",
"morgan": "^1.10.0",
"uuid": "^7.0.3",
"xhr2": "^0.2.0"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint && npm run test"
}
}
} Please, could you help me to solve this issue. |
I got the same error in cypress end-to-end script, when access to firestore.
Does anyone got an alternative solution for this ? |
OK, I've solved it myself.
|
[REQUIRED] Environment info
firebase-tools: 8.2.0
Platform: macOS
[REQUIRED] Test case
index.js
[REQUIRED] Steps to reproduce
Run the emulator (functions & firestore) with this code.
Modify a contact in firestore.
[REQUIRED] Expected behavior
The
users/${userId}
doc should be updated and you should see aUser successfully marked Updated
in the console.[REQUIRED] Actual behavior
Additional notes
If I replace the function markUserUpdated by the following one, then the error is not thrown.
Note also that the datas are perfectly loaded from Firestore into the app, so the Firestore Emulator is running normallly.
The text was updated successfully, but these errors were encountered: