随笔分类 -  报错整理

摘要:https://stackoverflow.com/questions/64732623/react-typescript-cannot-find-module-or-its-corresponding-type-declaration css.d.ts declare module '*.scss 阅读全文
posted @ 2022-04-24 18:23 Redchar 阅读(965) 评论(0) 推荐(0) 编辑
摘要:react-router-dom 默认版本问题, 改用hashrouter解决 import { HashRouter, Route, Switch, Redirect, Link } from 'react-router-dom' <HashRouter> <Switch> <Route path 阅读全文
posted @ 2021-10-07 12:43 Redchar 阅读(860) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/xulei1992/p/15176992.html https://segmentfault.com/a/1190000038956767 tsdx.config.js const postcss = require('rollup-plugin-po 阅读全文
posted @ 2021-08-23 17:49 Redchar 阅读(2070) 评论(0) 推荐(0) 编辑
摘要:// tsdx.config.js const images = require('@rollup/plugin-image'); module.exports = { rollup(config, options) { config.plugins = [ images({ include: [' 阅读全文
posted @ 2021-08-23 17:48 Redchar 阅读(476) 评论(0) 推荐(0) 编辑
摘要:检查package.json或者npm link时是否正确,更改后删掉node_modules重新安装 阅读全文
posted @ 2021-08-23 16:35 Redchar 阅读(526) 评论(0) 推荐(0) 编辑
摘要:此语法需要名为 "__spreadArray" 的导入帮助器 安装最新版tslib即可 阅读全文
posted @ 2021-08-20 14:50 Redchar 阅读(3118) 评论(0) 推荐(0) 编辑
摘要:如前文所示,在对应的index.d.ts/index.d.tsx中添加如下代码: interface Function { _toFixed(params: any): void; } Function.prototype._toFixed = function(params: any) { thi 阅读全文
posted @ 2021-08-19 14:29 Redchar 阅读(2283) 评论(0) 推荐(0) 编辑
摘要:类型“typeof BigNumber”的参数不能赋给类型“Value”的参数。 类型“typeof BigNumber”缺少类型“Instance”中的以下属性: c, e, s 原来: bigNumber._toFixed = function (...arg: any) { return ne 阅读全文
posted @ 2021-08-19 14:26 Redchar 阅读(529) 评论(0) 推荐(0) 编辑
摘要:Your rootDir is currently set to "./". Please change your rootDir to "./src".TSDX has deprecated setting tsconfig.compilerOptions.rootDir to "./" as i 阅读全文
posted @ 2021-08-19 11:47 Redchar 阅读(102) 评论(0) 推荐(0) 编辑
摘要:创建对应文件:如index.d.ts或者index.d.tsx。然后声明一下即可。 如果您不关心外部库的类型,并且希望将所有没有类型的库导入为any,则可以将其添加到具有.d.ts扩展名的文件中: declare module '*'; 这样做的好处(和缺点)是,您可以导入任何东西,TS可以编译。 阅读全文
posted @ 2021-08-19 11:34 Redchar 阅读(645) 评论(0) 推荐(0) 编辑
摘要:删除package-lock.json后重新安装即可 阅读全文
posted @ 2021-08-12 18:07 Redchar 阅读(1487) 评论(0) 推荐(1) 编辑
摘要:Error: Invalid hook call. Hooks can only be called inside of the body of a function component. 场景:sdk中使用antd,export之后前端工程引入报错 原因:react冲突 解决: "peerDepe 阅读全文
posted @ 2021-08-10 11:21 Redchar 阅读(2821) 评论(0) 推荐(0) 编辑
摘要:react 报错:'React' must be in scope when using JSX react/react-in-jsx-scope 解决: import React, {Component} from 'react'; R大写 阅读全文
posted @ 2021-08-09 21:54 Redchar 阅读(512) 评论(0) 推荐(0) 编辑
摘要:ERROR TypeError: fs.readdir is not a function lerna项目packages下,使用create-react-app创建的项目调用使用create-react-library创建的组件方法时报错 解决:未解决,删除create-react-app项目,重 阅读全文
posted @ 2021-08-09 16:17 Redchar 阅读(768) 评论(0) 推荐(1) 编辑
摘要:Failed to load config "react-app" to extend from. 解决: yarn add eslint-config-react-app 或者: yarn add eslint@latest 阅读全文
posted @ 2021-08-07 18:12 Redchar 阅读(1518) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示