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

regeneratorRuntime is not defined #4

Closed
jerzzhang opened this issue Feb 11, 2020 · 2 comments · Fixed by #5
Closed

regeneratorRuntime is not defined #4

jerzzhang opened this issue Feb 11, 2020 · 2 comments · Fixed by #5

Comments

@jerzzhang
Copy link

jerzzhang commented Feb 11, 2020

I am running into an issue importing Anvil.

const Anvil = require('@anvilco/anvil');
C:\Users\Ansel\Documents\development\endow-server\node_modules\@anvilco\anvil\lib\index.js:77
      regeneratorRuntime.mark(function _callee2(url, options) {
      ^

ReferenceError: regeneratorRuntime is not defined
    at C:\Users\Ansel\Documents\development\endow-server\node_modules\@anvilco\anvil\lib\index.js:77:7
    at C:\Users\Ansel\Documents\development\endow-server\node_modules\@anvilco\anvil\lib\index.js:176:6
    at Object.<anonymous> (C:\Users\Ansel\Documents\development\endow-server\node_modules\@anvilco\anvil\lib\index.js:292:2)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\Ansel\Documents\development\endow-server\lib\anvil.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\Ansel\Documents\development\endow-server\routes\nonprofit.js:7:34)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
[nodemon] app crashed - waiting for file changes before starting...
@benogle
Copy link
Contributor

benogle commented Feb 11, 2020

Hey @jerzzhang, the quick fix is to yarn add @babel/polyfill then import it before importing anvil. Though this is annoying if you are not using babel.

We are using async/await functions in the library which babel transpiles down with this regeneratorRuntime reference. We'll look into removing this dep...

@jerzzhang
Copy link
Author

Thank you!

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

Successfully merging a pull request may close this issue.

2 participants