dist/chrome-mv3/icons/128.png: unable to open for write
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
This only happens in CI but sometimes I get the following error.
[log] WXT 0.20.7
[info] Building chrome-mv3 for production with Vite 6.3.5
- Preparing...
[fail] Command failed after 31.4 s
Error: /home/runner/work/application/application/packages/agent/agent-web-extension/dist/chrome-mv3/icons/128.png: unable to open for write
unix error: No such file or directory
at Sharp.toFile (/home/runner/work/application/application/node_modules/.pnpm/sharp@0.33.5/node_modules/sharp/lib/output.js:90:19)
at /home/runner/work/application/application/node_modules/.pnpm/@wxt-dev+auto-icons@1.0.2_wxt@0.20.7_@types+node@22.17.0_jiti@2.4.2_less@4.1.3_lightnin_c28a655ca60a4242f2b243e857ab8ac5/node_modules/@wxt-dev/auto-icons/dist/index.mjs:47:23
at /home/runner/work/application/application/node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs:48:66
at /home/runner/work/application/application/node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs:48:56
A re-run usually fixes it.
I found this related issue in the Sharp repo: https://github.com/lovell/sharp/issues/1914
I tried to inject a keepfile using a hook but there isn't a hook in the correct place.
I guess it would need to be after cleaning dist dir and before writing to it.
Reproduction
Relevant config:
{
...
srcDir: 'src',
outDir: './dist',
modules: ['@wxt-dev/module-react', '@wxt-dev/auto-icons'],
autoIcons: {
grayscaleOnDevelopment: false,
},
}
Steps to reproduce
As mentioned above happens occasionally in CI, never on my development Mac laptop.
System Info
Github Actions
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 by tracing the @wxt-dev/auto-icons call site shown in the stack trace, including Sharp.toFile, and the build cleanup and output entry points that produce dist/chrome-mv3/icons/128.png. Reproduce the intermittent GitHub Actions failure if possible, then verify that a production Chrome MV3 build consistently writes the icon after the output directory is prepared.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript, vite
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100