ericgio / react-bootstrap-typeahead

React typeahead with Bootstrap styling
http://ericgio.github.io/react-bootstrap-typeahead/
MIT License
1.01k stars 408 forks source link

Package failing in parcel bundler #830

Closed gagdiez closed 1 year ago

gagdiez commented 1 year ago

Version

6.3.1

Steps to reproduce

Clone this repository: https://github.com/gagdiez/rbt-error-minimal

Then:

  1. yarn
  2. yarn start
  3. open browser in the URL indicated by parcel
  4. See error TypeError: Cannot read properties of undefined (reading 'default')

Expected Behavior

No error should be shown

Actual Behavior

Error appears: TypeError: Cannot read properties of undefined (reading 'default')`

ericgio commented 1 year ago

Hey @gagdiez thanks for the report! I believe this is an issue with Parcel, albeit a very strange one. It looks like this line is calling dest.hasOwnProperty(key). However, React-Bootstrap-Typeahead has a helper function named hasOwnProperty. So rather than calling the prototype function, Parcel is trying to invoke the util function from this library and failing because it passes the wrong arguments. So they probably should change how they call hasOwnProperty to something like Object.prototype.hasOwnProperty.call(dest, key).