Error: Cannot find module './helpers/populate/setPopulatedVirtualValue'

When deploy the code in render, it’s getting an error node modules not found. Please help me if anyone know this issue.

before deploying in render, make sure to host it anywhere for eg: mongodb atlas.

Got the same error, while trying to deploy, and cant figure out why.

I dont get what @biswa007 means by “make sure to host it anywhere”, in mongodb atlas you mean to make sure to include 0.0.0.0 ip address in the ip list?

If you mean that, i personally already did that, but still got the issue. There’s some deep documentation about that?

From your thread title, the error appears to be referencing the fact that it’s unable to find ./helpers/populate/setPopulatedVirtualValue.

Would you be able to post a screenshot of your logs for your attempted deploy?

I tried many times but I got same error. I think we missed some modules to install.


As you said, I uploaded the logs of deploy screenshot. If you figure out issue, please help me to deploy the code.

Does your application work locally? Do you have a repo hosted publicly?

mongoose recently did a refactor that split some code out into setPopulatedVirtualValue for multiple versions (8.1.2, 8.1.3, 8.2.0, 8.2.1, 8.2.2; commit).

Hi there,

Something that could be contributing to this issue is you may have committed your node_modules folder to git and are pushing it with the rest of your source code. You shouldn’t really do this as you could end up with module version conflicts between what you have locally and what you install on Render.

Please delete your node modules folders from git and add them to the .gitignore file and re-push your repo to GitHub. You also would want to run a build with a clear build cache after doing this.

Regards,

Keith
Render Support, UTC+10 :australia:

1 Like

Hi,

I didn’t push any node modules to the git. I just pushed the code without node modules, although the error will come when deploy the code. Is there any alternate solution from you.

Hi,

Yaa, It’s worked in my local. The mongoose refactor the code then what should I do now for resolve this issue.

Hi there,

Can you please use the Manual Deploy button with the Clear build cache & deploy option to redeploy your service using the latest commit.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.