sanity-io / sanity-algolia

Utilities for indexing Sanity documents in Algolia
MIT License
67 stars 16 forks source link

a runtime error related to `babel-plugin-transform-async-to-promises/helpers` #2

Closed eunjae-lee closed 3 years ago

eunjae-lee commented 3 years ago

Hello 👋🏼

I'm trying this toolkit and having a trouble.

[GET] /api/update-index
14:01:26:51
2020-12-14T13:01:27.336Z    undefined   ERROR   Cannot find module 'babel-plugin-transform-async-to-promises/helpers'Require stack:- /var/task/node_modules/sanity-algolia/dist/sanity-algolia.cjs.production.min.js- /var/task/node_modules/sanity-algolia/dist/index.js- /var/task/api/update-index.js- /var/task/___now_launcher.js- /var/runtime/UserFunction.js- /var/runtime/index.js2020-12-14T13:01:27.336Z undefined   ERROR   Did you forget to add it to "dependencies" in `package.json`?RequestId: fe62641a-01fc-4ecb-a716-b75ba965d3af Error: Runtime exited with error: exit status 1Runtime.ExitError

If you see https://www.npmjs.com/package/sanity-algolia/v/0.2.0 there are some code like

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var helpers = require('babel-plugin-transform-async-to-promises/helpers');
var sw = _interopDefault(require('stopword'));

function _asyncIterator(iterable) {

Not sure why babel-plugin-transform-async-to-promises is there but if needed, it should be one of the dependencies of this library.

runeb commented 3 years ago

@eunjae-lee Thanks for reporting. Seems to be a build issue. I've updates dependencies and published a new build with version 0.2.1. These helpers are not in the compiled source code. Could you try again and see if this cleared up your issues? Thanks again.