kinto.js
kinto.js copied to clipboard
ReferenceError: regeneratorRuntime is not defined
When I include kinto-http.js but don't use any generators or async functions myself, it works just fine, but when I use generators or async functions in my code while using babel-plugin-transform-runtime
(I haven't tested with the polyfill instead yet), I get an error: ReferenceError: regeneratorRuntime is not defined
which originates from the utils.js
file in kinto-http's lib
folder.
Yes, we compile our async functions using babel, and I guess it's being transformed into a version that uses regeneratorRuntime
. You will need the babel polyfill which provides it. We're not completely sure that we have the packaging right here (see for example https://github.com/Kinto/kinto-http.js/pull/159). I think the best possible thing would be to ship something very close to what's in src/
and rely on whoever is using the code to transpile it as necessary according to their use case. That's part of the reason we don't include babel-polyfill
as a dependency right now, although it's not a very good reason. Hope this helps!
Hi, could you try the new v4.4.1? We changed the packaging a little bit in refreence to some other regeneratorRuntime errors and it may have fixed your problem too.
Still seeing the error.