NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.61k stars 4.8k forks source link

taro3.6.4 #13585

Open liull89 opened 1 year ago

liull89 commented 1 year ago

相关平台 微信小程序


使用框架: react

复现步骤 "dependencies": { "@babel/runtime": "^7.7.7", "@tarojs/components": "3.6.4", "@tarojs/helper": "3.6.4", "@tarojs/plugin-platform-weapp": "3.6.4", "@tarojs/plugin-platform-alipay": "3.6.4", "@tarojs/plugin-platform-tt": "3.6.4", "@tarojs/plugin-platform-swan": "3.6.4", "@tarojs/plugin-platform-jd": "3.6.4", "@tarojs/plugin-platform-qq": "3.6.4", "@tarojs/plugin-platform-h5": "3.6.4", "@tarojs/runtime": "3.6.4", "@tarojs/shared": "3.6.4", "@tarojs/taro": "3.6.4", "@tarojs/plugin-framework-react": "3.6.4", "mobx": "^4.8.0", "mobx-react": "^6.1.4", "react-dom": "^18.0.0", "@tarojs/react": "3.6.4", "react": "^18.0.0" }, "devDependencies": { "@babel/core": "^7.8.0", "@tarojs/cli": "3.6.4", "@types/webpack-env": "^1.13.6", "@types/react": "^18.0.0", "postcss": "^8.4.18", "webpack": "5.69.0", "@tarojs/webpack5-runner": "3.6.4", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "react-refresh": "^0.11.0", "babel-preset-taro": "3.6.4", "eslint-config-taro": "3.6.4", "eslint": "^8.12.0", "eslint-plugin-react": "^7.8.2", "eslint-plugin-import": "^2.12.0", "eslint-plugin-react-hooks": "^4.2.0", "stylelint": "9.3.0" }

期望结果 能运行

实际结果 (node:22634) UnhandledPromiseRejectionWarning: /Users/liulanlan/study/taxchina/athena-neo4/node_modules/postcss-pxtransform/index.js:51 targetUnit = options.targetUnit ?? 'rem' ^

SyntaxError: Unexpected token '?' at wrapSafe (internal/modules/cjs/loader.js:1053:16) at Module._compile (internal/modules/cjs/loader.js:1101:27) at Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Object.newLoader [as .js] (/Users/liulanlan/study/taxchina/athena-neo4/node_modules/pirates/lib/index.js:141:7) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at getPostcssPlugins (/Users/liulanlan/study/taxchina/athena-neo4/node_modules/@tarojs/webpack5-runner/src/postcss/postcss.mini.ts:69:25) at MiniWebpackModule.getCSSLoaders (/Users/liulanlan/study/taxchina/athena-neo4/node_modules/@tarojs/webpack5-runner/src/webpack/MiniWebpackModule.ts:132:35) (node:22634) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:22634) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

环境信息 Taro v3.6.4 Node: 12.18.3

xuanzebin commented 1 year ago

老哥 node 版本略低,可以升级到 16 重新试试