0

I was trying to play with ECMA6... i have the experimental javascript flag enabled, but the next line throws an "uncaught SyntaxError: Unexpected reserved word import"

import {Pool} from 'maskera-client/modules/core/core-models.js';

I didn't find any info about this, just a bunch of things about Ecma6 to Ecma5 transpiler... the flag is enabled... It doesn't work in Chrome and Firefox. I saw older posts speaking about this features, but i can't make it work.

Thanks and sorry my bad english :) PD: The rest of the code is irrelevant i think...


EDIT: The "possible duplicated" doesn't solve my problem, also i'm asking for the es6 modules, not arrow functions... maybe they're supported, i don't know...

-- EDIT 2: Still not working :\

Emilio Grisolía
  • 1,183
  • 1
  • 9
  • 16
  • possible duplicate of [Using ECMAScript 6](http://stackoverflow.com/questions/24008366/using-ecmascript-6) – Evan Davis Jun 01 '15 at 14:26
  • I saw that post days ago... but i can't solve the problem yet. I want to know if there is another way of running ecma6 without a transpiler. – Emilio Grisolía Jun 01 '15 at 14:29
  • Even a year later it's still not implemented in any browser except Edge: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import - and even then it's behind a flag. Hopefully we don't have to wait too much longer! –  Jan 08 '17 at 09:32

1 Answers1

1

Check this blog post out: https://medium.com/dev-channel/es6-modules-in-chrome-canary-m60-ba588dfb8ab7

Support, at least in Canary behind the Experimental Web Platform flag, should be working. Try it out and see how it goes.

That said I cannot seem to get my chrome extension to work and continually get: Uncaught SyntaxError: Unexpected token import - although I'm not sure if this is extension specific (although it shouldn't be...!).

Good luck

GrayedFox
  • 2,350
  • 26
  • 44