Vite Plugin Error: Error occurs during dev run when configuring the code-inspector-plugin.
Open
Nobody has claimed this yet.
pending-triage
vite plugin
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Error occurs during dev run when configuring the code-inspector-plugin.
wxt.config.ts
import { resolve } from 'node:path'
import tailwindcss from '@tailwindcss/vite'
import { codeInspectorPlugin } from 'code-inspector-plugin'
import { defineConfig } from 'wxt'
// See https://wxt.dev/api/config.html
export default defineConfig({
extensionApi: 'chrome',
modules: ['@wxt-dev/module-react'],
manifest: {
name: 'Prime copilot',
icons: {
16: '/logo.png',
48: '/logo.png',
128: '/logo.png',
},
permissions: [
// 'sidePanel',
'scripting',
'tabs',
'activeTab',
'storage',
],
host_permissions: ['<all_urls>'],
// side_panel: {
// default_path: 'sidepanel/index.html',
// },
action: {
default_title: '点击打开侧边栏',
},
},
vite() {
return {
plugins: [
tailwindcss() as any,
codeInspectorPlugin({
bundler: 'vite',
exclude: /background/,
}),
],
resolve: {
// 插件的资源都要打包进去
alias: [
{
find: /@prime\/copilot-utils/,
replacement: resolve(__dirname, '../copilot-utils/index.ts'),
},
{
find: /@sidepanel/,
replacement: resolve(__dirname, './entrypoints/sidepanel'),
},
],
},
}
},
})
Reproduction
https://github.com/njzzzz/wtx-code-inspector-plugin
Steps to reproduce
pnpm install
pnpm dev
System Info
System:
OS: macOS 15.3.2
CPU: (8) arm64 Apple M1 Pro
Memory: 98.19 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.1 - ~/.nvm/versions/node/v20.18.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.18.1/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.18.1/bin/npm
pnpm: 9.15.2 - ~/.nvm/versions/node/v20.18.1/bin/pnpm
Browsers:
Chrome: 134.0.6998.166
Safari: 18.3.1
npmPackages:
wxt: ^0.19.29 => 0.19.29
Used Package Manager
pnpm
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduced wxt.config.ts and the Vite plugin configuration in https://github.com/njzzzz/wtx-code-inspector-plugin; run pnpm install and pnpm dev to capture the reported error. Trace how WXT 0.19.29 handles the configured plugins, then verify that the development run succeeds with code-inspector-plugin enabled and the background exclusion preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- tailwindcss, typescript, vite
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100