-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SFDX CLI: Error: Cannot find module 'lodash/core' #464
Comments
I can confirm that we're also having this problem starting some time after 7/8/2020 02:00 UTC |
|
We can confirm the same as well, due to this any fresh sfdx cli installation would be unable to load any sfdx plugins.. sfdx plugins:link is working fine |
For us this happens since about 14:00 (2PM) EST. So seems the lodash v4.17.17 causes this issue (https://www.npmjs.com/package/lodash). Here the error message:
|
@dsi0 Yes thats right, same behaviour |
We are also hitting this issue |
We have the same issue. |
I believe this points out a problem with how you are creating your npm distribution. You don't have a package-lock.json that fixes dependencies at specific versions. Without this, the npm installation is going to pull in new versions of dependency packages (like lodash). https://www.screencast.com/t/Ramob6Qhkh8M |
Hi All - Thanks for raising & reaching out on this issue. We're actively working on a resolution |
Same here! Pipelines has been breaking now! |
Same here... Happened to be making changes to our CI this morning so I thought it was something I did. Wasted my morning chasing geese 🤦 How is this happening? My CI is targeting a docker instance (image: salesforce/salesforcedx:7.33.2-full). Shouldn't the sfdx-cli command already be built? Or is it a problem that gets introduced when installing plugins? |
We're working to see if there's a workaround until lodash has a fix available. |
Here is the lodash issue lodash/lodash#4849 that is causing this transient dependency issue. The only known workaround right now is to use the Salesforce CLI installers or archives but I understand that may not be desirable to update CI jobs. |
@smaddox-sf can you not just target the previous version of lodash? Shouldn't dependency like this be "locked" in the the |
@ChuckJonas We can't because it is jsforce that is is using a carrot dependency. Hardcoding dependencies also have a size and perf implications on something the size of the CLI. We could potentially ship with shrinkwrap, but that would only work for This should really be done with lock files on the user running |
@ChuckJonas you will also notice the docker images, quite a while ago, have moved over to use archives other than npm. Updating your docker image will also fix this. |
looks like lodash released a new @amphro seems like if bundle size is a serious concern, you shouldn't use Or maybe |
I just did a fresh install and the problem now appears to be resolved. The lodash team put out a new version already. |
It not just about bundle size, but Ha! Ya, I agree about jsforce ;) but that is something we can't prioritize for now. |
Thanks, @amphro for your prompt help. I built a SFDX plugin (https://github.com/eltoroit/ETCopyData) that is failing due to this error, can you please let me know how to fix this issue in my plugin. Thanks |
Not sure if this fixed it, but I deleted node_modules, run ncu -u (to update dependencies) and deployed a beta package to pm. Now it works. |
@tfuda . Yes! Its works now for me too. |
Since today I'm getting an error whenever executing an sfdx command, that it cannot find the module 'lodash/core'. It is used in the file 'node_modules/jsforce/lib/api/analytics.js'. It happens when installing the cli freshly or up- / downgrading. There seems to be an issue with the dependency.
The text was updated successfully, but these errors were encountered: