Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

common-shakeify@0.6.1 crashes with browserify --full-paths option #32

Closed
feross opened this issue Jun 30, 2019 · 3 comments · Fixed by #33
Closed

common-shakeify@0.6.1 crashes with browserify --full-paths option #32

feross opened this issue Jun 30, 2019 · 3 comments · Fixed by #33
Labels

Comments

@feross
Copy link
Member

feross commented Jun 30, 2019

Issue did not exist in common-shakeify@0.6.0.

In common-shakeify@0.6.1, I started getting this error:

/Users/feross/code/bitmidi.com/node_modules/common-shakeify/index.js:92
    Object.keys(row.indexDeps).forEach((name) => {
           ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at DestroyableTransform.onfile [as _transform] (/Users/feross/code/bitmidi.com/node_modules/common-shakeify/index.js:92:12)
    at DestroyableTransform.Transform._read (/Users/feross/code/bitmidi.com/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/Users/feross/code/bitmidi.com/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at Labeled.Pipeline._write (/Users/feross/code/bitmidi.com/node_modules/stream-splicer/index.js:70:22)
    at doWrite (/Users/feross/code/bitmidi.com/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/Users/feross/code/bitmidi.com/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Labeled.Writable.write (/Users/feross/code/bitmidi.com/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Labeled.ondata (/Users/feross/code/bitmidi.com/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at Labeled.emit (events.js:198:13)
/Users/feross/code/bitmidi.com/node_modules/disc/bin/discify:59
    if (err) throw err
             ^

Looking at the changes made for 0.6.1 this definitely seems like it was introduced there. Haven't had a chance to look further into the cause.

The full command I'm using is browserify --no-detect-globals --extension mjs --plugin tinyify --full-paths . with latest browserify.

@goto-bus-stop
Copy link
Member

goto-bus-stop commented Jun 30, 2019

Crap, now I remember why I didn't use row.indexDeps in the first place 🤦‍♀️ 0.6.1 switched from using row.deps to row.indexDeps which is more consistent when using the -r flag.
thanks for the report. I think with fullPaths we can actually use row.deps, so could toggle which property it uses depending on whether that is enabled.

@goto-bus-stop
Copy link
Member

📦 0.6.2 disables the bugfix from 0.6.1 if you use --full-paths

@feross
Copy link
Member Author

feross commented Aug 1, 2019

Thanks for the quick fix!

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

Successfully merging a pull request may close this issue.

2 participants