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

Verbose mode throws an error when --full-paths flag is not used #35

Open
jeremija opened this issue May 3, 2020 · 0 comments
Open

Verbose mode throws an error when --full-paths flag is not used #35

jeremija opened this issue May 3, 2020 · 0 comments
Labels

Comments

@jeremija
Copy link

jeremija commented May 3, 2020

In verbose mode, the call to path.relative throws an error when --full-paths flag is not used. This is because the module name will be a number.

https://github.com/browserify/common-shakeify/blob/master/index.js#L30

Example:

$ browserify -g [ loose-envify purge --NODE_ENV production ] -p [ esmify ] -p [ common-shakeify -v ] -t babelify ./lib/index.js -o ./build/index.prod.js

internal/validators.js:112
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received type number
    at validateString (internal/validators.js:112:11)
    at Object.relative (path.js:1054:5)
    at /node_modules/common-shakeify/index.js:33:83
    at Array.forEach (<anonymous>)
    at Object.onModuleBailout (/node_modules/common-shakeify/index.js:28:17)
    at /node_modules/common-shakeify/index.js:152:14
    at Map.forEach (<anonymous>)
    at DestroyableTransform.onend [as _flush] (/node_modules/common-shakeify/index.js:140:22)
    at DestroyableTransform.prefinish (/node_modules/readable-stream/lib/_stream_transform.js:138:10)
    at DestroyableTransform.emit (events.js:223:5) {

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

No branches or pull requests

2 participants