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

babel-noob: Object.values not transpiled by babel? #1

Open
elsherbini opened this issue Aug 4, 2017 · 1 comment
Open

babel-noob: Object.values not transpiled by babel? #1

elsherbini opened this issue Aug 4, 2017 · 1 comment

Comments

@elsherbini
Copy link

First off, thanks for making this example repo and for making markovjs!

I'm using node v6.11.2
I can run this example fine with npm run-script start:dev

When I build using npm run-script build and try to run with npm run-script start I get the following error:

➜  markovjs-gridworld git:(master) npm run-script start

> [email protected] start /home/josephe/markovjs-gridworld
> node ./lib/index.js

/home/josephe/markovjs-gridworld/node_modules/regenerator-runtime/runtime.js:573
        throw exception;
        ^

TypeError: Object.values is not a function

I can solve this by installing the object.values shim and manually changing lib/index.js. Any idea why object.values doesn't get transpiled using the current defaults?

@lsunsi
Copy link
Owner

lsunsi commented Aug 5, 2017

The reason this happens is that Object.values is a feature from ES2017 spec, which was implemented from node v7 onwards. If you're running v6.11.2, it's only available through harmony flag I think. That said, babel should've taken care of it I think. I'm taking a look at it now.

Also, thanks for the kind words. (:

Yeah, it seems that's what's happening. I just pushed a change in babel preset and inclusion of polyfill, since this code isn't intended to be used in a library setting. Can you see if it works now, @elsherbini ?

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