wxt icon indicating copy to clipboard operation
wxt copied to clipboard

Build fails when the project's path contains `+`

Open namuorg opened this issue 1 month ago • 2 comments

[!NOTE] I wrote this issue and the PR using AI but reviewed everything myself. If AI contributions aren't welcome, feel free to close. I love this project and have contributed PRs to wxt in the past without any AI so hopefully that'll provide some assurance that I'm not here to contribute slop. :P

Describe the bug

wxt build fails when the project's absolute path contains a regex metacharacter such as +, e.g. a git worktree named after a branch with a slash (Claude Code names the worktree for sync/foo .claude/worktrees/sync+foo). A content script with a top-level CSS import then fails with:

ERROR  Cannot read properties of undefined (reading 'get')
    at TransformPluginContext.handler (…/vite/dist/node/chunks/node.js:30071:48)

The same project builds in a path without +.

I've opened #2717 with a fix (escaping the path) and a unit test.

Reproduction

https://github.com/namuorg/wxt-plus-path-repro

A content script that imports a CSS file, a background, and WXT 0.21.5. It fails when cloned into a directory whose path contains +, and builds otherwise.

Steps to reproduce

git clone https://github.com/namuorg/wxt-plus-path-repro wxt+plus
cd wxt+plus
npm install
npx wxt build    # ERROR  Cannot read properties of undefined (reading 'get')

cd ..
git clone https://github.com/namuorg/wxt-plus-path-repro wxt-plain
cd wxt-plain
npm install
npx wxt build    # ✔ Built extension

System Info

System:
  OS: macOS 27.0.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 2.84 GB / 64.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 26.13.0
  npm: 11.20.0
  pnpm: 12.8.1
Browsers:
  Chrome: 156.0.8078.79
  Firefox: 157.0.1
npmPackages:
  wxt: 0.21.5 => 0.21.5
  vite: 8.3.5 (via wxt)

Used Package Manager

npm

Validations

namuorg avatar Nov 02 '26 04:11 namuorg

Chill man! you can use AI to contribute whether it be issue or PR, but thing is you need to write the description and title by yourself. cause we're honestly exhausted by reading this long issues and PR descriptions.

nishu-murmu avatar Nov 04 '26 04:11 nishu-murmu

Totally fair! I've edited the title and description to be shorter and I'll handwrite those going forward.

namuorg avatar Nov 04 '26 06:11 namuorg