今天需要对一个将近一年没有动过的react老项目上添加一点需求。需求很简单,本以为可以光速完成,然后开启今天的摸鱼之旅。
代码写的很流畅,三下五除二就到了 git push 这一步,然后到gitlab上把代码一合并(项目使用的是Gitlab-CICD自动化构建),本以为到这里就打完收工了。
过了一会儿一看,居然build失败了,wath?打开控制台一看,报了如下错误:
/data/builds/HGeMevr6/0/xxx/node_modules/@types_react-router@5.1.19@@types/react-router/index.d.ts
TypeScript error in /data/builds/HGeMevr6/0/xxx/node_modules/@types_react-router@5.1.19@@types/react-router/index.d.ts(149,100): Type expected. TS1110
match<Params> | null;
export type ExtractRouteOptionalParam<T extends string, U = string | number | boolean> = T extends `${infer Param}?`