NervJS / taro-v2ex-hooks

使用 Taro 和 React Hooks 构建 v2ex 小程序
141 stars 15 forks source link

TypeError: (0 , _index.genCompid) is not a function #2

Open forconz opened 5 years ago

forconz commented 5 years ago

使用svn读取https://github.com/NervJS/taro-v2ex-hooks.git最新代码以后,运行: $ npm install $ npm i -g @tarojs/cli $ taro build --type weapp --watch

这个跑不起来的,出现下面错误: QQ截图20190719145017

再检查package.json ,和 Taro -v 版本不一样 "@tarojs/taro": "1.2.22",

Taro v1.3.9

两个版本不一致。

Taro-V2EX 此项目展示了如何在 Taro 中使用 React Hooks,需要 Taro 1.3 以上版本构建。

README.md 中的前一段文字,竟然也是错的...

写这个taro-v2ex-hooks项目的作者,非常不认真啊

forconz commented 5 years ago

QQ截图20190719150552 package.json 升级到最新以后,报上面的错误。

{
    "name": "v2ex",
    "version": "1.0.0",
    "private": true,
    "description": "v2ex-taro",
    "main": "index.js",
    "scripts": {
        "build:weapp": "taro build --type weapp",
        "build:h5": "taro build --type h5",
        "dev:weapp": "npm run build:weapp -- --watch",
        "dev:h5": "npm run build:h5 -- --watch",
        "test": "eslint src/ --ext .tsx"
    },
    "author": "",
    "license": "MIT",
    "dependencies": {
        "@tarojs/async-await":"1.3.9",
        "@tarojs/components":"1.3.9",
        "@tarojs/redux":"1.3.9",
        "@tarojs/redux-h5":"1.3.9",
        "@tarojs/router":"1.3.9",
        "@tarojs/taro":"1.3.9",
        "@tarojs/taro-h5":"1.3.9",
        "@tarojs/taro-weapp":"1.3.9",
        "babel-plugin-remove-dead-code":"1.3.2",
        "nervjs":"1.4.3",
        "redux":"4.0.4",
        "redux-actions":"2.6.5",
        "redux-logger":"3.0.6",
        "redux-thunk":"2.3.0",
        "timeago.js":"4.0.0-beta.2"
    },
    "devDependencies": {
        "@tarojs/cli":"1.3.9",
        "@tarojs/plugin-babel":"1.3.9",
        "@tarojs/plugin-csso":"1.3.9",
        "@tarojs/plugin-typescript":"1.3.9",
        "@tarojs/plugin-uglifyjs":"1.3.9",
        "@tarojs/webpack-runner":"1.3.9",
        "@types/node":"12.6.8",
        "@types/react":"16.8.23",
        "@types/redux-actions":"2.6.1",
        "babel-eslint":"10.0.2",
        "babel-plugin-transform-class-properties":"6.24.1",
        "babel-plugin-transform-decorators-legacy":"1.3.5",
        "babel-plugin-transform-define":"1.3.1",
        "babel-plugin-transform-es2015-template-literals":"6.22.0",
        "babel-plugin-transform-flow-strip-types":"6.22.0",
        "babel-plugin-transform-object-rest-spread":"6.26.0",
        "babel-preset-env":"1.7.0",
        "eslint":"6.0.1",
        "eslint-config-taro":"1.3.9",
        "eslint-plugin-import":"2.18.1",
        "eslint-plugin-react":"7.14.2",
        "eslint-plugin-taro":"1.3.9",
        "tslint":"5.18.0",
        "tslint-config-standard":"8.0.1",
        "tslint-react":"4.0.0",
        "typescript":"3.5.3",
        "typescript-eslint-parser":"22.0.0"
    }
}
yuche commented 5 years ago

你的模板和 cli 版本不一致就回报这个错误

forconz commented 5 years ago

Taro-V2EX 此项目展示了如何在 Taro 中使用 React Hooks,需要 Taro 1.3 以上版本构建。

项目说用了Taro 1.3,但是package.json的版本还是1.2的。

模板升级版本跟cli版本一致后,还是报错。