故事是这样的:..........
(算了估计你们也懒得听我讲故事,直接上接替方案)
插件官方回复:(送给和我一样苦苦挣扎好久的你们)
报错内容:
(node:19332) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of null
at CatchClause (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\src\utils\ast\visitorar.js:551:52)
at NodePath._call (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\path\context.js:45:20)
at NodePath.call (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\path\context.js:35:17)
at NodePath.visit (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\path\context.js:81:31)
at TraversalContext.visitQueue (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\context.js:86:16)
at TraversalContext.visitSingle (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\context.js:65:19)
at TraversalContext.visit (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\context.js:109:19)
at traverseNode (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\traverse-node.js:18:17)
at NodePath.visit (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\path\context.js:87:52)
at TraversalContext.visitQueue (C:\Users\86132\AppData\Roaming\npm\node_modules\miniprogram-to-uniapp\node_modules\@babel\traverse\lib\context.js:86:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:19332) 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: 2)
(node:19332) [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.
解决方法:
找到第一行对应的visitorar.js文件:
将内容修改为 : (我这里是551),根据你们的报错自行查找...
const err_name = (path.node.param) && (path.node.param).name || ""