botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
68 stars 83 forks source link

TypeError: _lodash.default.includes is not a function #747

Closed D3v3sh5ingh closed 4 years ago

D3v3sh5ingh commented 5 years ago

Describe the bug After deploy bot into a linux ubuntu nginx server using binary.Whenever i try to open botpress chat and type anything into it this error pops up in console and conversation remains empty

TypeError: _lodash.default.includes is not a function at router.post.asyncApi (/nodestart/src/modules/.cache/modulea7b55d174c2375ed1ee15d585f0e764e51ff3107bb04520bcf262684cf3f3203/dist/backend/api.js:141:26) 13:03:54.057 Mod[channel-web] HTTP Handling Error [TypeError, _lodash.default.includes is not a function] STACK TRACE TypeError: _lodash.default.includes is not a function at router.post.asyncApi (/nodestart/src/modules/.cache/modulea7b55d174c2375ed1ee15d585f0e764e51ff3107bb04520bcf262684cf3f3203/dist/backend/api.js:141:26) 13:03:59.499 Mod[channel-web] HTTP Handling Error [TypeError, _lodash.default.includes is not a function] STACK TRACE TypeError: _lodash.default.includes is not a function at router.post.asyncApi (nodestart/src/modules/.cache/modulea7b55d174c2375ed1ee15d585f0e764e51ff3107bb04520bcf262684cf3f3203/dist/backend/api.js:141:26) 13:04:02.050 Mod[channel-web] HTTP Handling Error [TypeError, _lodash.default.includes is not a function] STACK TRACE TypeError: _lodash.default.includes is not a function at router.post.asyncApi (/nodestart/src/modules/.cache/modulea7b55d174c2375ed1ee15d585f0e764e51ff3107bb04520bcf262684cf3f3203/dist/backend/api.js:141:26) .include was renamed to .contains, and that was later renamed to .includes. As of v.2.4.1, the rename to .includes had not happened yet. https://github.com/lodash/lodash/blob/a0a649aaeabb0b99300ecb32f80f060f3f39815d/vendor/underscore/underscore.js#L274 https://github.com/mgonto/restangular/issues/1298 The specification in package.json still says >=1.3.1 which is incorrect. In most cases you will get latest lodash which will work, but it projects that have a number of lodash versions npm may consolidate to an older version which will then break restangular.

To Reproduce Steps to reproduce the behavior:

  1. Deploy botpress
  2. Click on botpress chat icon
  3. Try typing into bot and click enter
  4. See error in console and chat remains empty

Environment (please complete the following information):

allardy commented 5 years ago

@D3v3sh5ingh That's weird, I don't have this error on my side. We could just use the native includes instead, i'll open a PR

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

epaminond commented 4 years ago

This was fixed already: https://github.com/botpress/botpress/commit/356e5cd85c56f1044319dd5aa622b0bcd1da3595