I am in the process of migrating to our own hosted parse-server and am going through setting it up locally. I am at the point where I am trying to run the cloud code locally. I moved it over to the /cloud directory in the parse-server-example directory. I then saw the note about modifying local paths to have ./ infront of the cloud path, and I noticed looking at the structure of the folders why that makes sense, with main.js being in the /cloud directory, it has to go down, then back into the cloud directory to find the modules directory.
I had a require('cloud/modules/file.js') which worked fine in the Parse.com server.
I changed it to require('./cloud/modules/file.js') as stated in the tutorial, however I am getting that error that is in the topic title.
Is there a step that I am missing or something? Everything looks to be correct path wise so I'm a bit baffled as to why this is not working.
I think I had the same issue before. It depends on the location of your file that requires the file.js.
I have file structure like so:
cloud/
|__main.js
|__modules/
|__file.js
My main.js, located in the cloud/ folder, requires file.js in the cloud/modules/ folder, changing the require path in my main.js to require('./modules/file.js') fixes the issue.
Hope that helps.
@refre5h thanks for the hint, that was the problem. I also had to fix some paths down in other modules as well, but it looks like I got it up and running now! Thanks again!
Most helpful comment
I think I had the same issue before. It depends on the location of your file that requires the
file.js.I have file structure like so:
My
main.js, located in thecloud/folder, requiresfile.jsin thecloud/modules/folder, changing the require path in mymain.jstorequire('./modules/file.js')fixes the issue.Hope that helps.