Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ReferenceError: regeneratorRuntime is not defined" with readme example #12

Open
deleteman opened this issue Aug 30, 2016 · 1 comment

Comments

@deleteman
Copy link

Hey I'm trying out the example from the readme file, but I'm getting an error.

Here's the code for the example:

'use strict'

var Ava = require("ava-ia").Ava;

var weather = require('ava-ia/lib/intents').weather;
var movie = require('ava-ia/lib/intents').movie;

var forecastYahoo = require("ava-ia/lib/actions").forecastYahoo;
var forecastMSN = require("ava-ia/lib/actions").forecastMSN;
var movieDB = require("ava-ia/lib/actions").movieDB;


// 1. New instance
const ava = new Ava({
  debug: true // If you want see intents/actions trace log.
});

// 2. Configure the intents
ava
  .intent(weather, [forecastYahoo, forecastMSN])
  .intent(movie, movieDB);

// 3. Chat with Ava
ava.listen('Do you know if tomorrow will rain in Bangkok?')
  .then(state => console.log(state))
  .catch(error => console.log(state))

And here's the error I'm getting:

/home/fernandodoglio/workspace/personal/ava/node_modules/ava-ia/lib/helpers/factoryActions.js:10
var ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(state, actions) {
^

ReferenceError: regeneratorRuntime is not defined
at /home/fernandodoglio/workspace/personal/ava/node_modules/ava-ia/lib/helpers/factoryActions.js:10:31
at Object. (/home/fernandodoglio/workspace/personal/ava/node_modules/ava-ia/lib/helpers/factoryActions.js:36:2)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/fernandodoglio/workspace/personal/ava/node_modules/ava-ia/lib/helpers/index.js:43:23)
at Module._compile (module.js:409:26)

@mjeries
Copy link
Contributor

mjeries commented Sep 26, 2016

The example seems to be using babel-polyfill and babel-register. If you do not have those, try installing and requiring them at the top of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants