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/swc-loader@0.2.6_@swc+core@1.4.17_@swc+helpers@0.4.36__webpack@5.91.0_@swc+core@1.4.17_@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/swc-loader@0.2.6_@swc+core@1.4.17_@swc+helpers@0.4.36__webpack@5.91.0_@swc+core@1.4.17_@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/core@1.3.75

重新运行:

相关推荐
BigYe程普17 分钟前
我开发了一个出海全栈SaaS工具,还写了一套全栈开发教程
开发语言·前端·chrome·chatgpt·reactjs·个人开发
前端张三34 分钟前
Mac 电脑pink 后端ip地址进行本地联调
服务器·tcp/ip·macos
余生H34 分钟前
前端的全栈混合之路Meteor篇:关于前后端分离及与各框架的对比
前端·javascript·node.js·全栈
程序员-珍37 分钟前
使用openapi生成前端请求文件报错 ‘Token “Integer“ does not exist.‘
java·前端·spring boot·后端·restful·个人开发
axihaihai41 分钟前
网站开发的发展(后端路由/前后端分离/前端路由)
前端
第六五42 分钟前
ubuntu命令行连接wifi
服务器·ubuntu
CXDNW1 小时前
【网络篇】计算机网络——应用层详述(笔记)
服务器·笔记·计算机网络·http·web·cdn·dns
流烟默1 小时前
Vue中watch监听属性的一些应用总结
前端·javascript·vue.js·watch
zeruns8021 小时前
如何搭建自己的域名邮箱服务器?Poste.io邮箱服务器搭建教程,Linux+Docker搭建邮件服务器的教程
linux·运维·服务器·docker·网站
2401_857297911 小时前
招联金融2025校招内推
java·前端·算法·金融·求职招聘