Skip to content

Create missing chromiumProfile directory before launching Chrome #2593

Description

@aleclarson

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions