Create missing chromiumProfile directory before launching Chrome
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
When webExt.chromiumProfile points to a directory that does not yet exist and keepProfileChanges: true, wxt dev fails before Chromium launches with an ENOENT for chrome-out.log.
This is especially surprising because the persistent profile documentation says the profile will be created on the next development run.
Reproduction
Use a project-local profile path that does not exist yet:
import { resolve } from 'node:path';
import { defineConfig } from 'wxt';
export default defineConfig({
webExt: {
chromiumProfile: resolve('.wxt/chrome-data'),
keepProfileChanges: true,
},
});
Then run:
wxt dev
Actual behavior
The process fails with an error like:
Error: ENOENT: no such file or directory, open
'.../.wxt/chrome-data/chrome-out.log'
The failure originates in chrome-launcher while preparing the launch.
Expected behavior
The configured Chromium user-data directory should be created before the browser is launched, and the first wxt dev run should succeed.
Suspected cause
In WXT 0.21.1, the web-ext runner forwards chromiumProfile and keepProfileChanges, but does not forward web-ext's profileCreateIfMissing option:
- WXT web-ext runner
- web-ext profile creation only runs when
profileCreateIfMissingis enabled - chrome-launcher preparation opens
chrome-out.logwithout creating a supplied user-data directory first
Could WXT either enable/forward profileCreateIfMissing for an explicitly configured persistent profile, or create the directory before invoking web-ext?
Environment
- WXT: 0.21.1
- web-ext: 10.6.0
- chrome-launcher: 1.2.0
- macOS
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 in packages/wxt/src/core/runners/web-ext.ts and compare the runner's options with web-ext's profileCreateIfMissing behavior. Reproduce the issue with the provided chromiumProfile and keepProfileChanges configuration. Done means the missing profile directory is created before launch and the first wxt dev run succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100