-
Notifications
You must be signed in to change notification settings - Fork 200
Description
插件版本
code-inspector-plugin version: 1.2.8
Bug 类型
[X] 安装插件后启动项目编译失败
[ ] 按住组合键无筛选框
[ ] 点击筛选框无法打开 IDE
[ ] 其他问题
Bug 描述
When using code-inspector-plugin with Next.js 15.5.3 and Turbopack, the project fails to compile with a TP1006 error. The error occurs in the plugin's transforms.ts file at line 53, where Turbopack cannot statically analyze the dynamic path.join operation.
Error Details:
[turbopack-node]/transforms/transforms.ts:53:10
lint TP1006 path.join(???*0*, (???*2* ? ???*5* : ???*7*)) is very dynamic
51 | }
52 | export const fromPath = (path: string) => {
> 53 | return join(contextDir, sep !== '/' ? path.replaceAll('/', sep) : path)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54 | }
The issue appears to be that Turbopack's static analysis cannot handle the dynamic path operations involving process.cwd() and path.sep.
系统
[ ] windows(未使用 wsl 虚拟机)
[ ] windows(使用了 wsl 虚拟机)
[X] mac
[ ] linux
你使用的打包器及版本
[ ] webpack
[ ] vite
[ ] rspack
[ ] umijs
[X] 其他: Turbopack (Next.js 15.5.3)
你使用的 web 框架
[ ] react
[ ] vue
[ ] nuxt
[X] next.js
[ ] svelte
[ ] astro
[ ] solid
[ ] preact
[ ] qwik
[ ] 其他
自检信息
[X] 你的浏览器、IDE、代码是否在一台机器上(非远程开发机或者云开发机情况)
[ ] 浏览器控制台是否有打印组合按键提示信息 (Cannot test due to compilation failure)
[ ] 页面 DOM 是否有注入 data-insp-path 属性 (Cannot test due to compilation failure)
配置信息
next.config.js:
const { codeInspectorPlugin } = require('code-inspector-plugin')
const nextConfig = {
// ... other config
webpack: (config, { dev, isServer }) => {
config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
return config
},
turbopack: {
rules: codeInspectorPlugin({
bundler: 'turbopack',
}),
},
// ... rest of config
}
Development command:
next dev --turbo
The plugin works fine with webpack but fails when using Turbopack. This appears to be a Turbopack-specific compatibility issue where the static analysis cannot handle the dynamic path operations in the plugin's transform code.