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

Unable to use custom chromium profile. --chromium-profile flag is not getting respected. #1909

Closed
ghost opened this issue May 19, 2020 · 13 comments

Comments

@ghost
Copy link

ghost commented May 19, 2020

Is this a feature request or a bug?

Bug

What is the current behavior?

As per the doc --chromium-profile takes the current path of the Chrome/Chromium profile, but every time Chrome is staring with a temporary profile instead of supplied one.

I am running

web-ext run --source-dir={source_dir} --target chromium --chromium-profile={chrome_profile_path} --start-url={start_url} --verbose

The verbose log on stdout

[program.js][info] Version: 4.2.0
[program.js][debug] Discovering config files. Set --no-config-discovery to disable
[config.js][debug] Discovered config "/home/djmsuman/.web-ext-config.js" does not exist or is not readable
[config.js][debug] Discovered config "/home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/web-ext-config.js" does not exist or is not readable
[program.js][info] Applying config file: ./package.json
[config.js][debug] Loading JS config file: "/home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/package.json" (resolved to "/home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/package.json")
[config.js][debug] Looking for webExt key inside package.json file
[config.js][debug] Config file /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/package.json did not define any options. Did you set module.exports = {...}?
[cmd/run.js][info] Running web extension from /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build
[util/manifest.js][debug] Validating manifest at /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build/manifest.json
[util/temp-dir.js][debug] Created temporary directory: /tmp/tmp-web-ext-27230BgUeUgsNz2cM
[extension-runners/chromium.js][debug] Creating reload-manager-extension in /tmp/tmp-web-ext-27230BgUeUgsNz2cM/reload-manager-extension-1589925088612
[extension-runners/chromium.js][debug] Starting Chromium instance...
[cmd/run.js][info] The extension will reload if any source file changes
[util/file-filter.js][debug] Resolved path **/*.xpi with sourceDir /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build to /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build/**/*.xpi
[util/file-filter.js][debug] Resolved path **/*.zip with sourceDir /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build to /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build/**/*.zip
[util/file-filter.js][debug] Resolved path **/.* with sourceDir /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build to /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build/**/.*
[util/file-filter.js][debug] Resolved path **/.*/**/* with sourceDir /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build to /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build/**/.*/**/*
[util/file-filter.js][debug] Resolved path **/node_modules with sourceDir /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build to /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build/**/node_modules
[util/file-filter.js][debug] Resolved path **/node_modules/**/* with sourceDir /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build to /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build/**/node_modules/**/*
[watcher.js][debug] Watching for file changes in /home/djmsuman/Workspace/BrowserExtentions/autopilot-admin/build
[extension-runners/index.js][info] Press R to reload (and Ctrl-C to quit)

What is the expected or desired behavior?

No

Version information (for bug reports)

  • Chrome version:
    83.0.4103.61

  • Your OS and version:
    Ubuntu 20.04 LTS

  • Node version:
    v12.16.3

  • NPM version:
    6.14.4

  • web-ext version:
    4.2.0

P.S. I am getting same issue on Windows 10 also.

@Rob--W
Copy link
Member

Rob--W commented May 20, 2020

Works for me, even with the latest version at 85.0.4151.0 on ArchLinux.

When I visit chrome://version , I do see --user-data-dir= twice, first with a directory lighthouse.[some random here], and then the value that I passed to --chromium-profile.

The "Profile Path" row shows the latter.

What made you think that the --chromium-profile flag is not respected?

@rpl
Copy link
Member

rpl commented May 28, 2020

This sounds like it may be related to the snap packaged chromium browser.

"I am getting same issue on Windows 10 also"
but this part makes it sounds that it could be something different.

@deepTier5 are you using a snap packaged Chrome or a deb packaged one?
could you try to use a deb package and double-check if you can still reproduce the same issue.

@ghost
Copy link
Author

ghost commented May 30, 2020

@rpl I am using Chrome (Debian package), installed from Google's official repo. I do have a Chromium installation as Snap package, but not using it as a target.

@ghost
Copy link
Author

ghost commented May 30, 2020

Hi @Rob--W

First of all thanks for the reply and showing me chrome://version to debug the problem. Now I'm able to use my Chrome profile as a run target because I was providing wrong path previously.

Thought, my problem is resolved, but I need some clarification regarding --chromium-profile argument since the official doc doesn't provide much insight (or may be incomplete).

To open my desired profile for Firefox I provide --firefox-profile ~/.mozilla/firefox/{hash}.default-release/. Now for Chrome I need to provide --chromium-profile ~/.config/google-chrome. Then Chrome is automatically opening the default profile form ~/.config/google-chrome/Default.

What if I want to open a Chrome profile from ~/.config/google-chrome/Profile 1, then what parameter and which path I need to provide?

Why does --firefox-profile accept path till profile directory but --chromium-profile accept path till --user-data-dir?

Why web-ext does not use Chrome/Chromium's command line argument --profile-directory along with --user-data-dir to open a desired profile instead of opening the default profile where for Firefox I can chose a desired profile?

@Rob--W
Copy link
Member

Rob--W commented May 30, 2020

If you want to use "Profile 1" instead of "Default", pass the desired name to --profile-directory as an argument to the Chrome binary (need to be in --arg so that web-ext doesn't parse it; also need a space as the first part of the value to --arg to work around #1846), like this:

web-ext run -t chromium --chromium-profile ~/.config/google-chrome --arg ' --profile-directory=Profile 1'

Why web-ext does not use Chrome/Chromium's command line argument --profile-directory along with --user-data-dir to open a desired profile instead of opening the default profile where for Firefox I can chose a desired profile?

web-ext run is only concerned with running a Chromium instance for testing. The fact that Chromium supports more "profiles" is not really an important distinction to web-ext. Also note that the directory specified by --user-data-dir will contain more directories/files besides the "Default" / "Profile 1" / etc. directories.

@ghost
Copy link
Author

ghost commented May 31, 2020

@Rob--W thanks a lot again for clarifying. It would be really helpful if the doc is updated.

@ghost ghost closed this as completed May 31, 2020
@pearnaly
Copy link
Contributor

pearnaly commented Jun 2, 2020

Hi @Rob--W & @deepTier5,
i'm affraid the topic is not solved. On my device chrome is using the first parameter --user-data-dir=...
command web-ext run --source-dir=dist --start-url="https://www.google.de" --start-url="chrome://version" --target=chromium --chromium-profile="C:\Users\Bill\AppData\Local\Google\Chrome\User Data" --arg=" --profile-directory=Profile 1"

copy from chrome://version/:

Google Chrome 83.0.4103.61 (Build ufficiale) (a 64 bit) (cohort: Stable)
Revisione 94f915a8d7c408b09cc7352161ad592299f384d2-refs/branch-heads/4103@{#561}
Sistema operativo Windows 10 OS Version 1909 (Build 18363.836)
JavaScript V8 8.3.110.9
Flash 24.0.0.189 internal-not-yet-present
User-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
Riga di comando "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=55781 --user-data-dir="C:\Users\Bill\AppData\Local\Temp\lighthouse.60140260" --disable-features=TranslateUI --disable-component-extensions-with-background-pages --disable-background-networking --disable-sync --metrics-recording-only --disable-default-apps --no-default-browser-check --no-first-run --disable-backgrounding-occluded-windows --disable-renderer-backgrounding --disable-background-timer-throttling --load-extension="C:\Users\Bill\AppData\Local\Temp\tmp-web-ext-1672SWBuH7L6H9HP\reload-manager-extension-1591105704935,E:\bill\dev\javascript-css-injetor\dist" --profile-directory="Profile 1" --user-data-dir="C:\Users\Bill\AppData\Local\Google\Chrome\User Data" --flag-switches-begin --flag-switches-end --enable-audio-service-sandbox chrome://version https://www.google.de
Percorso eseguibile C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
Percorso profilo C:\Users\Bill\AppData\Local\Temp\lighthouse.60140260\Profile 1

I think in web-ext/src/extension-runners/chromium.js we should add:
useDefaultProfile: !this.params.chromiumProfile
to the await this.chromiumLaunch(... call.

What do you think? Thank you for you help!

@Rob--W
Copy link
Member

Rob--W commented Jun 2, 2020

We should pass the directory via the userDataDir option instead of appending --user-data-dir (see chrome launcher implementation).

It's a small change, at

if (this.params.chromiumProfile) {
chromeFlags.push(`--user-data-dir=${this.params.chromiumProfile}`);
}
let startingUrl;
if (this.params.startUrl) {
const startingUrls = Array.isArray(this.params.startUrl) ?
this.params.startUrl : [this.params.startUrl];
startingUrl = startingUrls.shift();
chromeFlags.push(...startingUrls);
}
this.chromiumInstance = await this.chromiumLaunch({
enableExtensions: true,
chromePath: chromiumBinary,
chromeFlags,
startingUrl,
// Ignore default flags to keep the extension enabled.
ignoreDefaultFlags: true,
});

plus a change of the test in

sinon.assert.calledWithMatch(params.chromiumLaunch, {
ignoreDefaultFlags: true,
enableExtensions: true,
chromePath: undefined,
chromeFlags: [
...DEFAULT_CHROME_FLAGS,
`--load-extension=${reloadManagerExtension},/fake/sourceDir`,
'--user-data-dir=/fake/chrome/profile',
],
startingUrl: undefined,
});
(and maybe other occurrences around chromiumLaunch depending on the implementation)

Are you interested in contributing a patch?

@Rob--W Rob--W reopened this Jun 2, 2020
@pearnaly
Copy link
Contributor

pearnaly commented Jun 3, 2020

Hi @Rob--W, hum I was about to start. But I checked it out and flow is throwing 23 errors out out of the box (in master)!

Error -------------------------------------------------------------------------------------- src/firefox/index.js:115:12

Cannot call `fxRunner` with object literal bound to `params` because undefined [1] is incompatible with string [2] in
the indexer property of property `env`. [incompatible-call]

   src/firefox/index.js:115:12
                    v-
    115|     'env': {
    116|       ...process.env,
    117|       ...defaultFirefoxEnv,
    118|     },
             ^

References:
   ../../AppData/Local/Temp/flow/flowlib_19efae27/node.js:2599:36
   2599|   env : { [key: string] : string | void, ... };
                                            ^^^^ [1]
   src/firefox/index.js:53:20
     53|     [key: string]: string
                            ^^^^^^ [2]


Error --------------------------------------------------------------------------- tests/unit/test-cmd/test.lint.js:28:35

Cannot call `defaultLintCommand` with object literal bound to the first parameter because inexact object literal [1] is
incompatible with exact `LintCmdParams` [2]. [incompatible-exact]

   tests/unit/test-cmd/test.lint.js:28:35
                                         v-
   28|         return defaultLintCommand({
   29|           sourceDir: '/fake/source/dir',
   30|           ...params,
   31|         }, {
               ^ [1]

References:
   src/cmd/lint.js:74:6
   74|   }: LintCmdParams,
            ^^^^^^^^^^^^^ [2]


Error --------------------------------------------------------------------------- tests/unit/test-cmd/test.lint.js:31:12

Cannot call `defaultLintCommand` with object literal bound to the second parameter because inexact object literal [1] is
incompatible with exact `LintCmdOptions` [2]. [incompatible-exact]

   tests/unit/test-cmd/test.lint.js:31:12
                  v-
   31|         }, {
   32|           createLinter,
   33|           createFileFilter,
   34|           ...options,
   35|         });
               ^ [1]

References:
   src/cmd/lint.js:79:6
   79|   }: LintCmdOptions = {}
            ^^^^^^^^^^^^^^ [2]


Error ----------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:55:7

Cannot call `run` with object literal bound to the first parameter because inexact object literal [1] is incompatible
with exact `CmdRunParams` [2]. [incompatible-exact]

   tests/unit/test-cmd/test.run.js:55:7
   55|       {...argv, ...customArgv},
             ^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/cmd/run.js:95:6
   95|   }: CmdRunParams,
            ^^^^^^^^^^^^ [2]


Error ----------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:55:7

Cannot call `run` with object literal bound to the first parameter because property `firefox` is missing in object
literal [1] but exists in object type [2]. [prop-missing]

   tests/unit/test-cmd/test.run.js:55:7
   55|       {...argv, ...customArgv},
             ^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/cmd/run.js:95:6
   95|   }: CmdRunParams,
            ^^^^^^^^^^^^ [2]


Error ----------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:55:7

Cannot call `run` with object literal bound to the first parameter because property `preInstall` is missing in object
literal [1] but exists in `CmdRunParams` [2]. [prop-missing]

   tests/unit/test-cmd/test.run.js:55:7
   55|       {...argv, ...customArgv},
             ^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/cmd/run.js:95:6
   95|   }: CmdRunParams,
            ^^^^^^^^^^^^ [2]


Error ----------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:55:7

Cannot call `run` with object literal bound to the first parameter because property `preInstall` is missing in object
literal [1] but exists in object type [2]. [prop-missing]

   tests/unit/test-cmd/test.run.js:55:7
   55|       {...argv, ...customArgv},
             ^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/cmd/run.js:95:6
   95|   }: CmdRunParams,
            ^^^^^^^^^^^^ [2]


Error ----------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:55:7

Cannot call `run` with object literal bound to the first parameter because undefined [1] is incompatible with string [2]
in property `firefox`. [incompatible-call]

   tests/unit/test-cmd/test.run.js:55:7
   55|       {...argv, ...customArgv},
             ^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/cmd/run.js:29:12
   29|   firefox: string,
                  ^^^^^^ [2]


Error ---------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:55:20

Cannot call `run` with object literal bound to the first parameter because possibly missing property `firefox` in object
literal [1] is incompatible with string [2] in property `firefox`. [incompatible-call]

   tests/unit/test-cmd/test.run.js:55:20
   55|       {...argv, ...customArgv},
                          ^^^^^^^^^^ [1]

References:
   src/cmd/run.js:29:12
   29|   firefox: string,
                  ^^^^^^ [2]


Error ---------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:55:20

Cannot call `run` with object literal bound to the first parameter because possibly missing property `preInstall` in
object literal [1] is incompatible with boolean [2] in property `preInstall`. [incompatible-call]

   tests/unit/test-cmd/test.run.js:55:20
   55|       {...argv, ...customArgv},
                          ^^^^^^^^^^ [1]

References:
   src/cmd/run.js:35:15
   35|   preInstall: boolean,
                     ^^^^^^^ [2]


Error ----------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:56:7

Cannot call `run` with object literal bound to the second parameter because inexact object literal [1] is incompatible
with exact `CmdRunOptions` [2]. [incompatible-exact]

   tests/unit/test-cmd/test.run.js:56:7
    56|       {...options, ...customOpt}
              ^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/cmd/run.js:104:6
   104|   }: CmdRunOptions = {}): Promise<DefaultMultiExtensionRunner> {
             ^^^^^^^^^^^^^ [2]


Error --------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:132:12

Cannot delete `expectedRunnerParams.firefox` because undefined [1] is incompatible with string [2]. [incompatible-type]

   tests/unit/test-cmd/test.run.js:132:12
   132|     delete expectedRunnerParams.firefox;
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
   tests/unit/test-cmd/test.run.js:132:5
   132|     delete expectedRunnerParams.firefox;
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]
   tests/unit/test-cmd/test.run.js:114:16
   114|       firefox: '/path/to/custom/bin/firefox',
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2]


Error --------------------------------------------------------------------------- tests/unit/test-cmd/test.run.js:133:12

Cannot delete `expectedRunnerParams.pref` because undefined [1] is incompatible with object literal [2].
[incompatible-type]

   tests/unit/test-cmd/test.run.js:133:12
   133|     delete expectedRunnerParams.pref;
                   ^^^^^^^^^^^^^^^^^^^^^^^^^

References:
   tests/unit/test-cmd/test.run.js:133:5
   133|     delete expectedRunnerParams.pref;
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]
   tests/unit/test-cmd/test.run.js:115:13
   115|       pref: {'my.custom.pref': 'value'},
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2]


Error ----------------------------------------------- tests/unit/test-extension-runners/test.extension-runners.js:309:40

Cannot call `defaultWatcherCreator` with object literal bound to the first parameter because inexact object literal [1]
is incompatible with exact `WatcherCreatorParams` [2]. [incompatible-exact]

   tests/unit/test-extension-runners/test.extension-runners.js:309:40
   309|           return defaultWatcherCreator({...config, ...customConfig});
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/extension-runners/index.js:254:6
   254|   }: WatcherCreatorParams
             ^^^^^^^^^^^^^^^^^^^^ [2]


Error ----------------------------------------------- tests/unit/test-extension-runners/test.extension-runners.js:407:13

Cannot call `defaultReloadStrategy` with object literal bound to the first parameter because inexact object literal [1]
is incompatible with exact `ReloadStrategyParams` [2]. [incompatible-exact]

   tests/unit/test-extension-runners/test.extension-runners.js:407:13
   407|             {...args, ...argOverride},
                    ^^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/extension-runners/index.js:294:6
   294|   }: ReloadStrategyParams,
             ^^^^^^^^^^^^^^^^^^^^ [2]


Error ----------------------------------------------- tests/unit/test-extension-runners/test.extension-runners.js:408:13

Cannot call `defaultReloadStrategy` with object literal bound to the second parameter because inexact object literal [1]
is incompatible with exact `ReloadStrategyOptions` [2]. [incompatible-exact]

   tests/unit/test-extension-runners/test.extension-runners.js:408:13
   408|             {...options, ...optOverride});
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1]

References:
   src/extension-runners/index.js:299:6
   299|   }: ReloadStrategyOptions = {}
             ^^^^^^^^^^^^^^^^^^^^^ [2]


Error -------------------------------------------------- tests/unit/test-extension-runners/test.firefox-android.js:98:12

Cannot assign object literal to `runnerParams` because `EventEmitter` [1] is incompatible with `stream$Readable` [2] in
property `stdin`. [incompatible-type]

   tests/unit/test-extension-runners/test.firefox-android.js:98:12
   98|     stdin: new EventEmitter(),
                  ^^^^^^^^^^^^^^^^^^ [1]

References:
   src/extension-runners/firefox-android.js:83:11
   83|   stdin?: stream$Readable,
                 ^^^^^^^^^^^^^^^ [2]


Error ------------------------------------------------- tests/unit/test-extension-runners/test.firefox-android.js:936:15

Cannot call `FirefoxAndroidExtensionRunner` with object literal bound to `params` because possibly missing property
`keepProfileChanges` in object literal [1] is incompatible with boolean [2] in property `keepProfileChanges`.
[incompatible-call]

   tests/unit/test-extension-runners/test.firefox-android.js:936:15
   936|           ...(testCase.params),
                      ^^^^^^^^^^^^^^^ [1]

References:
   src/extension-runners/base.js:17:23
    17|   keepProfileChanges: boolean,
                              ^^^^^^^ [2]


Error ------------------------------------------------------------------- tests/unit/test-firefox/test.firefox.js:106:35

Cannot spread object literal because Flow cannot determine a type for object literal [1]. rest of object pattern [2] is
inexact, so it may contain `fxRunner` with a type that conflicts with `fxRunner`'s definition in object literal [1]. Try
making rest of object pattern [2] exact. [cannot-spread-inexact]

   tests/unit/test-firefox/test.firefox.js:106:35
                                          v-
   106|       return firefox.run(profile, {
   107|         fxRunner: createFakeFxRunner(),
   108|         findRemotePort: () => Promise.resolve(6000),
   109|         ...args,
   110|       });
              ^ [1]

References:
   tests/unit/test-firefox/test.firefox.js:103:12
   103|         ...args
                   ^^^^ [2]


Error --------------------------------------------------------------------- tests/unit/test-firefox/test.remote.js:37:46

Cannot call `defaultConnector` with `options` bound to the second parameter because inexact object literal [1] is
incompatible with exact `ConnectOptions` [2]. [incompatible-exact]

   tests/unit/test-firefox/test.remote.js:37:46
    37|       const connect = defaultConnector(port, options);
                                                     ^^^^^^^

References:
   tests/unit/test-firefox/test.remote.js:32:17
                        v-
    32|       options = {
    33|         connectToFirefox:
    34|           sinon.spy(() => Promise.resolve(fakeFirefoxClient())),
    35|         ...options,
    36|       };
              ^ [1]
   src/firefox/remote.js:217:49
   217|   {connectToFirefox = defaultFirefoxConnector}: ConnectOptions = {}
                                                        ^^^^^^^^^^^^^^ [2]


Error -------------------------------------------------------------------- tests/unit/test-firefox/test.remote.js:401:36

Cannot call `connectWithMaxRetries` with object literal bound to the first parameter because inexact object literal [1]
is incompatible with exact `ConnectWithMaxRetriesParams` [2]. [incompatible-exact]

   tests/unit/test-firefox/test.remote.js:401:36
                                           v-
   401|       return connectWithMaxRetries({
   402|         maxRetries: 0, retryInterval: 1, port: 6005, ...opt,
   403|       }, deps);
              ^ [1]

References:
   src/firefox/remote.js:240:50
   240|   {maxRetries = 250, retryInterval = 120, port}: ConnectWithMaxRetriesParams,
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2]


Error ------------------------------------------------------------------- tests/unit/test-util/test.file-filter.js:10:27

Cannot call `FileFilter` with object literal bound to the first parameter because inexact object literal [1] is
incompatible with exact `FileFilterOptions` [2]. [incompatible-exact]

   tests/unit/test-util/test.file-filter.js:10:27
                                 v-
   10|     return new FileFilter({
   11|       sourceDir: '.',
   12|       ...params,
   13|     });
           ^ [1]

References:
   src/util/file-filter.js:51:6
   51|   }: FileFilterOptions = {}) {
            ^^^^^^^^^^^^^^^^^ [2]


Error --------------------------------------------------------------------------------- tests/unit/test.config.js:958:34

Cannot call `discoverConfigFiles` with object literal bound to the first parameter because inexact object literal [1] is
incompatible with exact `DiscoverConfigFilesParams` [2]. [incompatible-exact]

   tests/unit/test.config.js:958:34
                                         v-
   958|       return discoverConfigFiles({
   959|         // By default, do not look in the real home directory.
   960|         getHomeDir: () => '/not-a-directory',
   961|         ...params,
   962|       });
              ^ [1]

References:
   src/config.js:150:30
   150|   {getHomeDir = os.homedir}: DiscoverConfigFilesParams = {}
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^ [2]

do I have a config problem?

@Rob--W
Copy link
Member

Rob--W commented Jun 3, 2020

Are you using the same version of flow as the one specified by the package.json / package-lock.json file?

@pearnaly
Copy link
Contributor

pearnaly commented Jun 3, 2020

Update for @Rob--W: now it's compiling! Indeed I had a newer version globally, and even if I provided it in PATH the spawnSync('flow') command in flow.js didn't want to find it. I had to hardcode the full path here. I realy prefer typescript sofar... But I move forward to our fix

@pearnaly
Copy link
Contributor

pearnaly commented Jun 3, 2020

ok, I have the changes locally (as you described)! But I am not allowed to push my patch branch... Do I have to be a project member for it?

@Rob--W
Copy link
Member

Rob--W commented Jun 3, 2020

You need to fork the project to your own account, push to your repo and then open a new pull request.

After forking the repo, you need to add your fork as a new remote to your local git repo. Then you can push to this new remote, and then open a PR via Github.

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

No branches or pull requests

3 participants