Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run.target: ["chromium"] ignored in config #3314

Open
fregante opened this issue Nov 28, 2024 · 2 comments
Open

run.target: ["chromium"] ignored in config #3314

fregante opened this issue Nov 28, 2024 · 2 comments

Comments

@fregante
Copy link
Contributor

fregante commented Nov 28, 2024

Is this a feature request or a bug?

bug

What is the current behavior?

A plain $ web-ext run will read/validate webExt.run.target from my package.json, but then it ignores it.

// package.json
{
  "webExt": {
    "run": {
      "target": ["chromium"]
    }
  }
}

This verbose log line explains why: the CLI parser is providing its own defaults before merging with the config file.

[web-ext/lib/config.js][debug] Favoring CLI: target=firefox-desktop over configuration: target=chromium

What is the expected or desired behavior?

The config file should be respected by applying the defaults after reading the config file.

Version information (for bug reports)

  • Your OS and version: macOS 15.1.1
node --version && npm --version && web-ext --version
v23.1.0
10.9.0
8.3.0
@Rob--W
Copy link
Member

Rob--W commented Dec 5, 2024

This message is emitted from

web-ext/src/config.js

Lines 121 to 124 in 958e1d4

log.debug(
`Favoring CLI: ${option}=${argvFromCLI[option]} over ` +
`configuration: ${option}=${configObject[option]}`,
);
. We probably have a bug there that we should fix.

@fregante
Copy link
Contributor Author

fregante commented Dec 7, 2024

the CLI parser is providing its own defaults before merging with the config file.

Likely here:

default: 'firefox-desktop',

Yargs is passing the default the same way it would pass a user-provided flag, therefore overriding any config that is found later.

I'd review other such defaults in the file. If they're all ignored the same way, they should probably all be removed.

Yargs' own docs/bugtracker probably detail how to deal with configuration vs flag overrides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants