browserify / browserify/common-shakeify

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

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
103
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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 ()
at Object.onModuleBailout (/node_modules/common-shakeify/index.js:28:17)
at /node_modules/common-shakeify/index.js:152:14
at Map.forEach ()
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) {

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.