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

doesn't work with ES6 (via babel-node) #45

Closed
bcherny opened this issue May 3, 2015 · 1 comment
Closed

doesn't work with ES6 (via babel-node) #45

bcherny opened this issue May 3, 2015 · 1 comment

Comments

@bcherny
Copy link

bcherny commented May 3, 2015

static is a reserved word in ES6, so import static from 'koa-static' fails to transpile:

> babel-node --harmony index.js

/Users/boris/foobar/node_modules/babel/node_modules/babel-core/lib/babel/helpers/parse.js:80
    throw err;
          ^
SyntaxError: /Users/boris/foobar/index.js: The keyword 'static' is reserved (4:7)
  3 | import route from 'koa-route'
> 4 | import static from 'koa-static'

related to #32

@bcherny
Copy link
Author

bcherny commented May 3, 2015

for anyone that has this issue in the future, the solution is simpler than i thought - just implicitly alias the module name:

import koaStatic from 'koa-static'

es6 doesn't care what you call a module's default export.

@bcherny bcherny closed this as completed May 3, 2015
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

1 participant