Additions/Updates

Why does the following code work for updating Algolia but does not allow additions?

        index.addObject(results[0], function(err) {
            callback(err || null, body);
        });

I keep getting index error: Unable to import module ‘index’: Error at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/var/task/index.js:4:23) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (m
Unable to import module ‘index’: Error at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/var/task/index.js:4:23)
at Module._compile (module.js:570:32)
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)

This looks like a problem with the JavaScript. Can you share more of the code or paste it into a Codepen and share the link? Thanks.

@dzello yeah this was not related to Algolia in the end; my apologies!

1 Like