我正在尝试部署到firebase,但是当我"firebase deploy“时,我仍然会得到以下错误:
=== Deploying to 'korchiedotcom'...
i deploying functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run build
> build
> tsc
../node_modules/@types/react-router-dom/index.d.ts:13:10 - error TS2305: Module '"react-router"' has no exported member 'match'.
13 import { match } from 'react-router';
~~~~~
../node_modules/@types/react-router-dom/index.d.ts:19:5 - error TS2305: Module '"react-router"' has no exported member 'PromptProps'.
19 PromptProps,
~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:20:5 - error TS2305: Module '"react-router"' has no exported member 'Prompt'.
20 Prompt,
~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:23:5 - error TS2305: Module '"react-router"' has no exported member 'RedirectProps'.
23 RedirectProps,
~~~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:24:5 - error TS2724: '"react-router"' has no exported member named 'Redirect'. Did you mean 'redirect'?
24 Redirect,
~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:25:5 - error TS2305: Module '"react-router"' has no exported member 'RouteChildrenProps'.
25 RouteChildrenProps,
~~~~~~~~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:26:5 - error TS2305: Module '"react-router"' has no exported member 'RouteComponentProps'.
26 RouteComponentProps,
~~~~~~~~~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:31:5 - error TS2305: Module '"react-router"' has no exported member 'StaticRouterProps'.
31 StaticRouterProps,
~~~~~~~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:32:5 - error TS2305: Module '"react-router"' has no exported member 'StaticRouter'.
32 StaticRouter,
~~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:33:5 - error TS2305: Module '"react-router"' has no exported member 'SwitchProps'.
33 SwitchProps,
~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:34:5 - error TS2305: Module '"react-router"' has no exported member 'Switch'.
34 Switch,
~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:35:5 - error TS2305: Module '"react-router"' has no exported member 'match'.
35 match,
~~~~~
../node_modules/@types/react-router-dom/index.d.ts:37:5 - error TS2305: Module '"react-router"' has no exported member 'withRouter'.
37 withRouter,
~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:38:5 - error TS2305: Module '"react-router"' has no exported member 'RouterChildContext'.
38 RouterChildContext,
~~~~~~~~~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:39:5 - error TS2305: Module '"react-router"' has no exported member 'useHistory'.
39 useHistory,
~~~~~~~~~~
../node_modules/@types/react-router-dom/index.d.ts:42:5 - error TS2724: '"react-router"' has no exported member named 'useRouteMatch'. Did you mean 'RouteMatch'?
42 useRouteMatch,
~~~~~~~~~~~~~
Found 16 errors in the same file, starting at: ../node_modules/@types/react-router-dom/index.d.ts:13
Error: functions predeploy error: Command terminated with non-zero exit code 2我正在运行的类型记录和反应的最新版本-路由器-多姆。我试过重新安装react路由器-dom并更新它。我甚至尝试过对节点_模块/@types/react路由器-dom/index.ts文件做一些修改,然后将其更改为默认的。
有什么建议吗?我在这里撞到砖墙了!
谢谢!
发布于 2022-10-22 17:14:28
您可以尝试删除@types/react-router-dom依赖项,在v6类型中,react-router-dom中提供了这些依赖项。
https://stackoverflow.com/questions/74165202
复制相似问题