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

--harmony_modules flag not work #2976

Closed
Pana opened this issue Sep 21, 2015 · 5 comments
Closed

--harmony_modules flag not work #2976

Pana opened this issue Sep 21, 2015 · 5 comments
Labels
question Issues that look for answers.

Comments

@Pana
Copy link

Pana commented Sep 21, 2015

When use ES6 module feature like this

node --harmony_modules tmp/es6Test.js

it throw an error

import { stat, exists, readFile } from 'fs';
^^^^^^

SyntaxError: Unexpected token import

My node is the 4.0.0 version

@brendanashworth brendanashworth added the question Issues that look for answers. label Sep 21, 2015
@bnoordhuis
Copy link
Member

Harmony modules aren't implemented yet, see https://nodejs.org/en/docs/es6/. As a rule of thumb, if a feature requires a flag to enable, expect it to be incomplete or broken.

Duplicate of #518, #2760 and probably others.

@Alhadis
Copy link
Contributor

Alhadis commented Nov 5, 2015

Just out of curiosity, why is there even a flag to enable support for an unsupported feature? If it does nothing, it's just confusing a lot of people who're expecting import statements to work...

@Fishrock123
Copy link
Contributor

@Alhadis It comes from a dependency -- V8.

@Alhadis
Copy link
Contributor

Alhadis commented Nov 5, 2015

Alright, well, that implies that V8 does support modules to some extent, but any supported features that it exposes are inaccessible to NodeJS. Or am I wrong?

@Fishrock123
Copy link
Contributor

No it doesn't really support modules at this time. Not ES6 modules anyways.

There was some old "modules" code laying around in there and that flag enables it for testing. Or used to anyways.

On Nov 5, 2015, at 11:06 AM, John Gardner notifications@github.com wrote:

Alright, well, that implies that V8 does support modules to some extent, but any supported features that it exposes are inaccessible to NodeJS. Or am I wrong?


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

5 participants