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

Error while specifying multiple --watch-file options #2104

Closed
ankushduacodes opened this issue Dec 28, 2020 · 2 comments · Fixed by #2125
Closed

Error while specifying multiple --watch-file options #2104

ankushduacodes opened this issue Dec 28, 2020 · 2 comments · Fixed by #2125

Comments

@ankushduacodes
Copy link
Contributor

ankushduacodes commented Dec 28, 2020

Is this a feature request or a bug?

Enhancement

What is the current behavior?

I was trying to test the platform to add some documentation for --watch-file option over at extension-workshop and tried to specify two --watch-file with commands:

web-ext run -s ~/Documents/GitHub/web-ext/borderify/ -t firefox-desktop --watch-file ~/Documents/GitHub/web-ext/borderify/_.js --watch-file ~/Documents/GitHub/web-ext/borderify/borderify.js

and got an error

Applying config file: ./package.json
Running web extension from /Users/ankushdua/Documents/GitHub/web-ext/borderify
Use --verbose or open Tools > Web Developer > Browser Console to see logging
Installed /Users/ankushdua/Documents/GitHub/web-ext/borderify as a temporary add-on
The extension will reload if any source file changes

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
    at validateString (internal/validators.js:124:11)
    at Object.dirname (path.js:1128:5)
    at WatcherManager.watchFile (/Users/ankushdua/Documents/GitHub/web-ext/node_modules/watchpack/lib/watcherManager.js:27:23)
    at Watchpack.<anonymous> (/Users/ankushdua/Documents/GitHub/web-ext/node_modules/watchpack/lib/watchpack.js:38:49)
    at Array.map (<anonymous>)
    at Watchpack.watch (/Users/ankushdua/Documents/GitHub/web-ext/node_modules/watchpack/lib/watchpack.js:37:28)
    at onSourceChange (/Users/ankushdua/Documents/GitHub/web-ext/dist/webpack:/src/watcher.js:76:11)
    at createWatcher (/Users/ankushdua/Documents/GitHub/web-ext/dist/webpack:/src/extension-runners/index.js:263:10)
    at reloadStrategy (/Users/ankushdua/Documents/GitHub/web-ext/dist/webpack:/src/extension-runners/index.js:313:30)
    at run (/Users/ankushdua/Documents/GitHub/web-ext/dist/webpack:/src/cmd/run.js:249:5)

Error code: ERR_INVALID_ARG_TYPE

What is the expected or desired behavior?

Is it possible to specify multiple files? if not, shouldn't this be good to have that as an option?
Am I doing something wrong here?

Version information (for bug reports)

  • Firefox version: Mozilla Firefox (84.0.1)
  • Your OS and version: MacOS 11.0.1
  • Paste the output of these commands:
node --version && npm --version && web-ext --version

v14.15.0
6.14.8
master-b3f590bd1cd9ac8a2de70b289bd7dac6645c89f0

@rpl
Copy link
Member

rpl commented Jan 13, 2021

As I did mention in #2122 (which was a duplicate for this issue that I filed yesterday) we have two options:

  • options 1: a more clear error that tells the user that --watch-file can only be passed ones
  • options 2: support multiple --watch-file options

We discussed about this in our triage meeting today and we agreed options 2 is our preferred approach.

@Dexterp37
Copy link
Contributor

I'm adding documentation for this in mozilla/extension-workshop#910

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

Successfully merging a pull request may close this issue.

3 participants