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

Error: Cannot find module 'lodash' #346

Closed
mcianc opened this issue Aug 26, 2023 · 1 comment · Fixed by #347
Closed

Error: Cannot find module 'lodash' #346

mcianc opened this issue Aug 26, 2023 · 1 comment · Fixed by #347

Comments

@mcianc
Copy link

mcianc commented Aug 26, 2023

The new import { isObject } from 'lodash' in the rule-result.js file generate the following exception for me.

image

using the lodash.isobjectlike package you should use
import { isObject } from 'lodash.isobjectlike'

I used to have "json-rules-engine": "^6.1.2"' in my dependencies, and under the hood it was was automatically updated to the last version after your last 6.4.0 release.
Sorted forcing the package to the initial version "json-rules-engine": "6.1.2"'

If I'm not in wrong the lodash package is not used in any other source files, most problalby it can be entirely removed from devDependencies, it will not installed when used package will be installed using npm ci

My project details:

  • monorepo using lerna
  • server app using nestjs
  • json-rules-engine imported in a package imported from server as a local dependency
chris-pardy pushed a commit to RateGravity/json-rules-engine that referenced this issue Aug 26, 2023
We didn't have lodash as a dependency instead having lodash.isObject
builds were working because lodash was a dev dependency.

Resolves CacheControl#346
chris-pardy pushed a commit to RateGravity/json-rules-engine that referenced this issue Aug 26, 2023
We didn't have lodash as a dependency instead having lodash.isObject
builds were working because lodash was a dev dependency.

Resolves CacheControl#346
@chris-pardy
Copy link
Collaborator

@mcianc thanks for the bug report I've pushed a new patch version that should resolve this issue for you.

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

Successfully merging a pull request may close this issue.

2 participants