Skip to content

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

Description

@ankushduacodes

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions