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

重新运行:

相关推荐
幺零九零零32 分钟前
【计算机网络】TCP协议面试常考(一)
服务器·tcp/ip·计算机网络
云飞云共享云桌面2 小时前
8位机械工程师如何共享一台图形工作站算力?
linux·服务器·网络
逐·風2 小时前
unity关于自定义渲染、内存管理、性能调优、复杂物理模拟、并行计算以及插件开发
前端·unity·c#
Devil枫2 小时前
Vue 3 单元测试与E2E测试
前端·vue.js·单元测试
尚梦3 小时前
uni-app 封装刘海状态栏(适用小程序, h5, 头条小程序)
前端·小程序·uni-app
GIS程序媛—椰子3 小时前
【Vue 全家桶】6、vue-router 路由(更新中)
前端·vue.js
前端青山4 小时前
Node.js-增强 API 安全性和性能优化
开发语言·前端·javascript·性能优化·前端框架·node.js
毕业设计制作和分享4 小时前
ssm《数据库系统原理》课程平台的设计与实现+vue
前端·数据库·vue.js·oracle·mybatis
幺零九零零5 小时前
【C++】socket套接字编程
linux·服务器·网络·c++
清灵xmf6 小时前
在 Vue 中实现与优化轮询技术
前端·javascript·vue·轮询