Giter Club home page Giter Club logo

algolia-firebase-functions's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @fobo66
  • ๐Ÿ‘€ Iโ€™m interested in Android development, philosophy and gaming
  • ๐ŸŒฑ Iโ€™m currently learning Estonian language
  • โ˜•๏ธ Buy me a coffee if you feel like it

@fobo66's Holopin board

algolia-firebase-functions's People

Contributors

amv-bamboo avatar dependabot-preview[bot] avatar dependabot[bot] avatar fobo66 avatar renovate-bot avatar renovate[bot] avatar yuriploc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

algolia-firebase-functions's Issues

TypeError: Cannot read property 'exists' of undefined at Object.syncAlgoliaWithFirestore

I'm trying to use Algolia with Firebase Functions, but I get this error TypeError: Cannot read property 'exists' of undefined at Object.syncAlgoliaWithFirebase (/workspace/node_modules/algolia-firebase-functions/dist/index.js:79:23) I followed the steps on the npm algolia-firebase-functions library (https://www.npmjs.com/package/algolia-firebase-functions).

How could I get rid of this error?
Any help would be appreciated!

This is my Firebase function code:

const admin = require('firebase-admin')
admin.initializeApp(functions.config().firebase)
const db = admin.firestore()
const algoliasearch = require("algoliasearch");
const algoliaFunctions = require('algolia-firebase-functions');


const algolia = algoliasearch(functions.config().algolia.app,
                              functions.config().algolia.key);
const index = algolia.initIndex(functions.config().algolia.index);


exports.indexBesedilo = functions.firestore.document('besedila/{document}').onCreate((change, context) =>
    algoliaFunctions.syncAlgoliaWithFirebase(index, change)
)```

Update to 3.0.0 (breaking changes)

Proposal

Update to Node.js 8.x (LTS) and algoliasearch 3.30.x

Why

  • Firebase Cloud Functions can run on Node.js 8.x
  • Node.js 8.x support Object.entries and Object.values
  • Algoliasearch 3.30.x support Promises (docs)

As this can cause breaking changes to the users who are still running Cloud Functions on Node.js 6.x, I suggest the package change the major to 3.x.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

bun
package.json
  • algoliasearch 4.23.3
  • firebase-admin 12.1.1
  • firebase-functions 5.0.1
  • @types/sinon 17.0.3
  • @typescript-eslint/eslint-plugin 7.11.0
  • @typescript-eslint/parser 7.11.0
  • eslint 8.57.0
  • firebase-functions-test 3.3.0
  • sinon 18.0.0
  • ts-node 10.9.2
  • ts-sinon 2.0.2
  • typescript 5.4.5
  • node >= 14
github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4.1.7
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/coverage.yml
  • actions/checkout v4.1.7
  • oven-sh/setup-bun v2
  • codacy/codacy-coverage-reporter-action v1
.github/workflows/node.js.yml
  • actions/checkout v4.1.7
  • oven-sh/setup-bun v2
  • actions/cache v4.0.2
.github/workflows/npm-publish.yml
  • actions/checkout v4.1.7
  • actions/setup-node v4
  • actions/checkout v4.1.7
  • actions/setup-node v4
npm
package.json
  • algoliasearch 4.23.3
  • firebase-admin 12.1.1
  • firebase-functions 5.0.1
  • @types/sinon 17.0.3
  • @typescript-eslint/eslint-plugin 7.11.0
  • @typescript-eslint/parser 7.11.0
  • eslint 8.57.0
  • firebase-functions-test 3.3.0
  • sinon 18.0.0
  • ts-node 10.9.2
  • ts-sinon 2.0.2
  • typescript 5.4.5
  • node >= 14

  • Check this box to trigger a request for Renovate to run again on this repository

npm install package

Cannot find module 'algolia-firebase-functions'
this is my package.json
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "14"
},
"main": "index.js",
"dependencies": {
"algolia-firebase-functions": "^4.1.0",
"algoliasearch": "^4.10.2",
"firebase-admin": "^9.8.0",
"firebase-functions": "^3.14.1"
},
"devDependencies": {
"eslint": "^7.6.0",
"eslint-config-google": "^0.14.0",
"firebase-functions-test": "^0.2.0"
},
"private": true
}

Firebase real time cloud function not working.

I have exactly did what you did but I am getting following issue.How to solve it?

C:\Users\NIKHIL MAHATO\Desktop\Algolia_Firebase\functions\index.js
20:73 error Parsing error: Unexpected token ;

โœ– 1 problem (1 error, 0 warnings)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! algolia-firebase-functions@ lint: eslint .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the algolia-firebase-functions@ lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\NIKHIL MAHATO\AppData\Roaming\npm-cache_logs\2020-11-09T07_14_20_884Z-debug.log
events.js:167
throw er; // Unhandled 'error' event
^

Error: spawn npm --prefix "%RESOURCE_DIR%" run lint ENOENT
at notFoundError (C:\Users\NIKHIL MAHATO\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (C:\Users\NIKHIL MAHATO\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (C:\Users\NIKHIL MAHATO\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
Emitted 'error' event at:
at ChildProcess.cp.emit (C:\Users\NIKHIL MAHATO\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)

Error: functions predeploy error: Command terminated with non-zero exit code1

Function Deploy Error: Unexpected Token )

The recent PR #2 seems to have introduced an issue when attempting to deploy functions. The polyfill is introducing the issue.

Deployment error.
Function load error: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: /user_code/node_modules/algolia-firebase-functions/values-entries-polyfill.js:16
);
^

SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/user_code/node_modules/algolia-firebase-functions/index.js:16:29)

exists function [breaking changes ]

Proposal

Change exists function to property

Why

The error :


TypeError: change.after.exists is not a function
    at Object.exports.syncAlgoliaWithFirebase (/user_code/node_modules/algolia-firebase-functions/index.js:73:21)
    at exports.syncAlgoliaWithFirebase.functions.firestore.document.onWrite (/user_code/index.js:15:26)
    at cloudFunctionNewSignature (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:105:23)
    at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:135:20)
    at /var/tmp/worker/worker.js:768:24
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

I will make a pull request if necessary

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.