ljharb / prop-types-tools

Custom React PropType validators
MIT License
671 stars 50 forks source link

Dependency of `object.entries`? #9

Closed SiqiTian-minted closed 7 years ago

SiqiTian-minted commented 7 years ago

Can't build in webpack, seeing the following error:

TypeError: Object.entries is not a function
    at propsThunkify (/Users/siqitian/src/app-renderer/node_modules/airbnb-prop-types/build/between.js:106:17)
    at betweenValidator (/Users/siqitian/src/app-renderer/node_modules/airbnb-prop-types/build/between.js:144:20)
    at Object.<anonymous> (/Users/siqitian/src/app-renderer/node_modules/airbnb-prop-types/build/sequenceOf.js:41:101)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
/Users/siqitian/src/app-renderer/dev-server/dev-server.js:81
      throw (e);
      ^

Shall we include the shim of object.entries?

ljharb commented 7 years ago

The readme says "Use of airbnb-js-shims or the equivalent is assumed." - that includes the polyfill for it.

I'd recommend including airbnb-js-shims in your top-level app.

ljharb commented 7 years ago

I've addressed this with b09134f93d1fb45a8c48d5a0e6c265fdbad3a1ee by removing the requirement to polyfill. (see also https://github.com/airbnb/react-dates/issues/405#issuecomment-289521845 and #10)

Released as v2.5.2.