deepflow grafana plugin 编译问题解决

修改tsconfig.js 增加"noImplicitAny": false,解决代码类型没有指定,显示Any 错误

To solve the error, explicitly set the parameter's type to any, use a more specific type or set noImplicitAny to false in tsconfig.json.

https://bobbyhadz.com/blog/typescript-parameter-implicitly-has-an-any-type#:\~:text=The "Parameter 'X' implicitly has an 'any' type",type or set noImplicitAny to false in tsconfig.json.

{

"extends": "./.config/tsconfig.json",

"compilerOptions": {

"noImplicitAny": false

}

}

2.This syntax requires an imported helper but module 'tslib' cannot be found

pnpm install tslib@latest

https://bobbyhadz.com/blog/typescript-syntax-requires-imported-helper-but-module-tslib-cannot#:\~:text=To solve the error "This syntax requires an,IDE is using the correct (workspace) TypeScript version.

  1. 错误信息:

RROR in ./module.ts

Module build failed (from ../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]_@[email protected]_@swc+h_rr3j462mo335la4upn5l7exuzi/node_modules/swc-loader/src/index.js):

Error: failed to handle: base_dir(`./src`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other words, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.

webpack 5.91.0 compiled with 1 error in 327 ms

Type-checking in progress...

thread '<unnamed>' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_transforms_module-0.180.19/src/path.rs:122:13:

base_dir(`./src`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other words, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.9.0

YOUR TYPESCRIPT VERSION: 4.9.5

Please only submit bug reports when using the officially supported version.

=============

assets by status 583 KiB [cached] 10 assets

./module.ts 39 bytes [built] [1 error]

ERROR in ./module.ts

Module build failed (from ../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]_@[email protected]_@swc+h_rr3j462mo335la4upn5l7exuzi/node_modules/swc-loader/src/index.js):

Error: failed to handle: base_dir(`./src`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other words, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.

webpack 5.91.0 compiled with 1 error in 947 ms

解决: 降@swc/core 版本

pnpm install @swc/[email protected]

重新运行:

相关推荐
bloglin999994 分钟前
npm和nvm和nrm有什么区别
前端·npm·node.js
2501_906314324 分钟前
MCP-RAG 服务器:完整设置和使用指南
运维·服务器
2501_9102275419 分钟前
web3 前端常见错误类型以及错误捕获处理
前端·web3
IP管家30 分钟前
物联网设备远程管理:基于代理IP的安全固件更新通道方案
服务器·网络·物联网·网络协议·tcp/ip·安全·ip
搬码临时工36 分钟前
远程连接电脑的方法?异地远程桌面连接和三方软件实现
运维·服务器·网络·物联网·电脑·远程工作
窦再兴1 小时前
来一个复古的技术FTP
linux·运维·服务器
哎哟喂_!1 小时前
Node.js 同步加载问题详解:原理、危害与优化策略
前端·chrome·node.js
__BMGT()1 小时前
C++ QT图片查看器
前端·c++·qt
陌路物是人非1 小时前
uniapp取消浏览自动填充
java·服务器·uni-app
未来之窗软件服务1 小时前
solidwors插件 开发————仙盟创梦IDE
前端·javascript·数据库·ide·仙盟创梦ide