Closed mazzy89 closed 8 years ago
@mazzy89 this is now fixed in 3.0.2, please verify.
@phpnode still doesn't work. this is the error I get:
error given was: SyntaxError: /Users/mazzy/vagrant-devbox/koa-project/src/server.js: Unexpected token (24:15)
22 | }
23 |
> 24 | function foo (): boolean {
| ^
25 | if (Math.random() > 0.5) {
26 | return true
27 | } else {
@mazzy89 that's a different issue, either because babel-plugin-syntax-flow
isn't enabled or because you're not stripping flow types after compilation (babel-plugin-transform-flow-strip-types
). Please could you post your package.json
and .babelrc
?
this is my package.json:
{
"name": "koa-project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"engines": {
"node": ">= 4"
},
"scripts": {
"dev": "better-npm-run dev"
},
"betterScripts": {
"dev": {
"command": "node bin/server",
"env": {
"NODE_CONFIG_DIR": "./src/config"
}
}
},
"keywords": [],
"author": "mazzy89 <apocalipse89@gmail.com>",
"license": "MIT",
"dependencies": {
"config": "1.17.1",
"koa": "2.0.0-alpha.3",
"koa-logger": "2.0.0",
"piping": "0.3.0"
},
"devDependencies": {
"babel-core": "6.2.1",
"babel-eslint": "4.1.5",
"babel-plugin-transform-async-to-generator": "6.1.18",
"babel-plugin-typecheck": "3.0.2",
"better-npm-run": "0.0.4",
"eslint": "1.9.0",
"eslint-config-airbnb": "1.0.0",
"eslint-config-standard": "4.4.0",
"eslint-plugin-react": "3.9.0",
"eslint-plugin-standard": "1.3.1"
}
}
and this is babelrc
{
"plugins": [
"typecheck",
"transform-async-to-generator"
]
}
@mazzy89 please see the section I added to the README in #56
This is my .babelrc config file:
while this is my code:
whatever function I try to verify I get always an error like this:
I have tried with different function but always a similar error.