Module not found: Error: Can't resolve 'src/App' in '/opt/render/project/src/src'

Hello,

I’ve been a Starter-tier Render user for several months now, having launched (successfully) a few apps during that time.

However, it’s been awhile, and I may have forgotten something.

I just tried launching a new app, but am getting a weird error: “Module not found: Error: Can’t resolve ‘src/App’ in ‘/opt/render/project/src/src’”

Based on the error, I’m wondering why the compiler is looking in the folder " …/src/src"?


A2

Attached is a screenshot of the error message as well as my directory tree. The App.js file appears to be correctly included in the src folder, so I’m not sure what is causing the problem? In my settings, I haven’t specified a default Root directory.

Any ideas on what may be causing the problem and how to fix?

Thanks and Regards,

Rob

Hi Rob,

Thanks for reaching out here.

I can confirm that you don’t have any Render-related setting like the root directory that would be causing that additional src directory. Can you see if there might be something configured in your package.json that could be causing this?

Additionally, I understand that you’ve set this up as a static site, but I also see your publish directory specified as react-app-rewired start, which seems more like an application start command, where we would generally expect a directory here. I’m wondering if you are instead intending to run this as a web service?

Best,

Hi Jade,

Appreciate your quick response.

I took a look at my package.json, but didn’t see what could be creating the issue (I’ve attached screen shots below just in case). In addition, I’ve created a webservice to host the files and deployed it from there. However, same issue as before.

Any other ideas what might be causing this?



Thanks and Regards,

Rob

Hi Rob,

Thanks for checking that. Can you also check any import statements in your files that might be referencing src/App incorrectly? i.e. Not correctly in relation to the file?

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