menu

Canner

⚡️A Content Management Framework Canner standardized Content Management Architecture for enterprises, create custom Content Management System easy and fast.. Support us 👉https://opencollective.com/cannercms

Channels
Team

Firestore integration is broken

March 9, 2019 at 4:20pm

Firestore integration is broken

March 9, 2019 at 4:20pm
Screen Shot 2019-03-09 at 8.12.25 AM.png

Enviorment: OSX: v10.14.3 node: v11.11 npm: v6.7.0 @canner/cli: v3.2.12

canner.cloud.js

const {FirestoreCredential} = require("canner-credential");
exports.graphql = {
dataSources: {
"default": [new FirestoreCredential(require("./cert.json"))],
}
}

canner.schema.js

import CannerScript, {Body} from 'canner-script';
import Posts from './schema/posts.schema.js';
import Categories from './schema/categories.schema';
import BodyComponent from './components/layout/body';
import {ImgurStorage} from '@canner/storage';
export const imageStorage = new ImgurStorage({
clientId: 'a214c4836559c77'
});
const schema = (
<root imageStorage={imageStorage}>
<Body component={BodyComponent}>
<Posts dataSource={{name: 'firestore'}} />
<Categories dataSource={{name: 'firestore'}} />
</Body>
</root>
);

canner.server.js

const {FirestoreDataSource} = require('@gqlify/firestore');
const admin = require('firebase-admin');
const cert = require('./cert.json');
exports.graphql = {
dataSources: {
firestore: args => new FirestoreDataSource({
config: {
credential: admin.credential.cert(cert),
databaseURL: `https://${cert.project_id}.firebaseio.com`
},
collection: args.key,
}),

package.json

{
"name": "canner-project",
"version": "1.0.0",
"description": "canner project",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@gqlify/firestore": "^3.1.0",
"@gqlify/server": "^3.1.2",
"firebase-admin": "^7.0.0"
}
}
Screen Shot 2019-03-09 at 8.19.03 AM.png

March 15, 2019 at 11:08am

Hi, @matthewharwood, sorry about the late reply, I can't reproduce this issue even in the same version of node and cli. But according the infomration(https://stackoverflow.com/questions/49758008/nodejs-error-failed-to-load-grpc-binary-module-because-it-was-not-installed-fo), please try the two methods to solve this.

  1. npm rebuild
  2. rm -rf node_modules and npm i Hope this helps. Thanks!
  • reply
  • like

March 16, 2019 at 3:45pm

Yeah let's close this one out. I'm not getting the bug anymore; however, I'm still unable to get firebase to work leaving it in another converstation.

  • reply
  • like