Closed dejiemiabata closed 2 years ago
it seems that the post request is being redirected to a Google login page which returns html but the request is expecting json
@i14h okay do you know the right approach to creating a transform function that will work with algolia search ?
@dejiemiabata Try creating a function that allows unauthenticated invocations.
@smomin I have allowed unauthenticated invocations but the error still persists. Also, just noticed that by default, callable functions have the invoker set to public
@smomin still not working
I am looking into it. I will let you know my findings.
@smomin I noticed the PROJECT_ID was pointing to the wrong project. Sorry for the confusion here.
I am trying to utilise the transform functions option within Algolia. I have tried the following to no avail and I keep getting errors such as “unexpected token < in json”.
Basically, my posts collection has a userId field which I am trying to transform before sending to algolia. The transformed function should grab the userId field and output data from the users collection.
Below you can see the transform function I am testing out + errors.
I tried using the reference here: https://github.com/algolia/firestore-algolia-search. Is there a better example for how to use transformFunctions in algolia ?
{"severity":"ERROR","message":"Error when performing Algolia index FetchError: invalid json response body at https://accounts.google.com/ServiceLogin?passive=true&continue=https://uc.appengine.google.com/_ah/conflogin%3Fstate%3D~AJKiYcFxxGMUMqCfFkvubLonYRaXN50w_Kw_5BO6hlCr9LlWPxIaPm01U1D5BFEJR2W5JR-Q8ongrJkEq0TKW5n2ihpQV2fsjUTIDVdnrzDWqXPPEx6C20M3Z_QT4XokgmlYmS-QMqceAyKYJuVu3YrbfKddijM1rIc-rvF8z8WPfBqr4zjFjlu1tPjDHrsyl58Ic8grr-onj-vSrdsfM3id89TcPaADCP18cFoHU1zKHz6Kk3SY2SrUhsAi6gNM6OQrkgwtT83R reason: Unexpected token < in JSON at position 1\n at /Users/xxxxx/.npm/_npx/0ca4ecfa9810ae5b/node_modules/node-fetch/lib/index.js:273:32\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at async Object.exports.default (/Users/ddddd/.npm/_npx/0ca4ecfa9810ae5b/node_modules/firestore-algolia-search/lib/transform.js:29:26)\n at async Object.extract [as default] (/Users/xxxx/.npm/_npx/0ca4ecfa9810ae5b/node_modules/firestore-algolia-search/lib/extract.js:42:21)\n at async processQuery (/Users/xxx/.npm/_npx/0ca4ecfa9810ae5b/node_modules/firestore-algolia-search/lib/import/index.js:54:29) {\n type: 'invalid-json'\n}"}