Taro: typescript version bug

Created on 9 Dec 2019  ·  14Comments  ·  Source: NervJS/taro

typescript version bug

image

dev build error

image

All 14 comments

CC @Littly

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

报错是配置文件里的 Copy 字段写的有问题

@Garfield550 It's a new project without make any change, what should I do?

delete copy property on config/index.js

const config = {
  copy: { // delete this
    patterns: [],
  },
};

still error

image

what's .temp ?

that's really bad developer experience

only the most simple demo can run(no ts, no redux, no scss), still need manually modify the config file!

image

why import not exist module?

{
  "name": "xcxApp",
  "version": "1.0.0",
  "private": true,
  "description": "xcx-app h5",
  "templateInfo": {
    "name": "redux",
    "typescript": true,
    "css": "sass"
  },
  "scripts": {
    "build:weapp": "taro build --type weapp",
    "build:swan": "taro build --type swan",
    "build:alipay": "taro build --type alipay",
    "build:tt": "taro build --type tt",
    "build:h5": "taro build --type h5",
    "build:rn": "taro build --type rn",
    "build:qq": "taro build --type qq",
    "build:quickapp": "taro build --type quickapp",
    "dev:weapp": "npm run build:weapp -- --watch",
    "dev:swan": "npm run build:swan -- --watch",
    "dev:alipay": "npm run build:alipay -- --watch",
    "dev:tt": "npm run build:tt -- --watch",
    "dev:h5": "npm run build:h5 -- --watch",
    "dev:rn": "npm run build:rn -- --watch",
    "dev:qq": "npm run build:qq -- --watch",
    "dev:quickapp": "npm run build:quickapp -- --watch"
  },
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@tarojs/async-await": "1.3.27",
    "@tarojs/components": "1.3.27",
    "@tarojs/components-qa": "1.3.27",
    "@tarojs/router": "1.3.27",
    "@tarojs/taro": "1.3.27",
    "@tarojs/taro-alipay": "1.3.27",
    "@tarojs/taro-h5": "1.3.27",
    "@tarojs/taro-qq": "1.3.27",
    "@tarojs/taro-quickapp": "1.3.27",
    "@tarojs/taro-swan": "1.3.27",
    "@tarojs/taro-tt": "1.3.27",
    "@tarojs/taro-weapp": "1.3.27",
    "nervjs": "^1.5.5",
    "nerv-devtools": "^1.5.5",
    "redux": "^4.0.0",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@types/react": "^16.4.8",
    "@types/webpack-env": "^1.13.6",
    "@tarojs/plugin-babel": "1.3.27",
    "@tarojs/plugin-csso": "1.3.27",
    "@tarojs/plugin-sass": "1.3.27",
    "@tarojs/plugin-uglifyjs": "1.3.27",
    "@tarojs/webpack-runner": "1.3.27",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-jsx-stylesheet": "^0.6.5",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "babel-eslint": "^8.2.3",
    "eslint": "^5.16.0",
    "eslint-config-taro": "1.3.27",
    "eslint-plugin-react": "^7.8.2",
    "eslint-plugin-react-hooks": "^1.6.1",
    "eslint-plugin-import": "^2.12.0",
    "stylelint": "9.3.0",
    "stylelint-config-taro-rn": "1.3.27",
    "stylelint-taro-rn": "1.3.27",
    "eslint-plugin-taro": "1.3.27",
    "@typescript-eslint/parser": "^1.6.0",
    "typescript": "^3.0.1"
  }
}

very confused code

image

image

Sorry.

Config file has a bug, we fixed today.

We supported TypeScript, please re-init a new project and answer the question "? 是否需要使用 TypeScript ?" as "Yes".

image

Missing @tarojs/redux-h5 should be a template bug, we will fix later.

solution

just following below steps

  1. comment out ./config/index.js 's copy object

image

  1. you have to manually install yarn add @tarojs/redux-h5 (if using Redux)

image

Was this page helpful?
0 / 5 - 0 ratings