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

ERR_INVALID_ARG_TYPE error when using multiple --watch-file cli options #2122

Closed
rpl opened this issue Jan 12, 2021 · 1 comment
Closed

ERR_INVALID_ARG_TYPE error when using multiple --watch-file cli options #2122

rpl opened this issue Jan 12, 2021 · 1 comment

Comments

@rpl
Copy link
Member

rpl commented Jan 12, 2021

Is this a feature request or a bug?

bug

What is the current behavior?

Execute web-ext run with multiple --watch-file options:
web-ext run --watch-file public/build/build.js --watch-file public/addon-build/background.js --watch-file public/addon-build/content.js

The following error is logged:

[program.js][error]
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
    at new NodeError (node:internal/errors:278:15)
    at validateString (node:internal/validators:123:11)
    at Object.dirname (node:path:1172:5)
    at WatcherManager.watchFile (/.../node_modules/watchpack/lib/watcherManager.js:27:23)
    at Watchpack.<anonymous> (/.../node_modules/watchpack/lib/watchpack.js:38:49)
    at Array.map (<anonymous>)
    at Watchpack.watch (/home/dexter/rally-core-addon/node_modules/watchpack/lib/watchpack.js:37:28)
    at u (/home/dexter/rally-core-addon/node_modules/web-ext/dist/web-ext.js:1:25310)
    at g (/home/dexter/rally-core-addon/node_modules/web-ext/dist/web-ext.js:1:13097)
    at m (/home/dexter/rally-core-addon/node_modules/web-ext/dist/web-ext.js:1:13437)
6:33

The issue is likely triggered because passing --watch-file multiple times does make it an array instead of a string.

What is the expected or desired behavior?

  • 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
@rpl
Copy link
Member Author

rpl commented Jan 13, 2021

Closing as a duplicate of #2104 (which was already filed for the same issue).

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

1 participant