browserify / browserify/common-shakeify

Just upgraded to v1 - TypeError: Cannot read properties of undefined (reading 'dedupe')

Open
#42 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

Just upgraded the dependencies in an old project and tried re-running the browserify portion.

common-shakeify v1.1.1
Node 16.16.0
OSX Arm

```javascript
b = browserify(options).plugin(commonShakeify, {});

b.transform('babelify', {
presets: ['@babel/preset-env'],
sourceMaps: true
});
```

So just using the default options, but when running it I get:
```
TypeError: Cannot read properties of undefined (reading 'dedupe')
at /node_modules/common-shakeify/index.js:150:15
at Map.forEach ()
at DestroyableTransform.onend [as _flush] (/node_modules/common-shakeify/index.js:143:22)
at DestroyableTransform.prefinish (/node_modules/readable-stream/lib/_stream_transform.js:138:10)
at DestroyableTransform.emit (node:events:527:28)
at DestroyableTransform.emit (node:domain:537:15)
at prefinish (/node_modules/readable-stream/lib/_stream_writable.js:619:14)
at finishMaybe (/node_modules/readable-stream/lib/_stream_writable.js:627:5)
at endWritable (/node_modules/readable-stream/lib/_stream_writable.js:638:3)
at DestroyableTransform.Writable.end (/node_modules/readable-stream/lib/_stream_writable.js:594:41)
at DestroyableTransform.onend (/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (node:events:641:28)
at DestroyableTransform.emit (node:events:539:35)
at DestroyableTransform.emit (node:domain:537:15)
at endReadableNT (/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

```

Any ideas what this might be? Not changed anything other than the version numbers of packages.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at common-shakeify/index.js:143-150 and trace the value whose dedupe property is read during _flush; compare that path with the shown browserify plugin setup and dependency versions. Reproduce with Node 16.16.0, common-shakeify 1.1.1, and the default options; done means this setup no longer throws the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.