Create missing chromiumProfile directory before launching Chrome
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 devActual 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
Source: wxt-dev/wxt