While working on the Back End Development and API certification I have been running into this issue where I’m unable to run the app in Replit. Currently, it’s throwing this error message in the console:
I have been able to work around the issue by refreshing the page and then trying to run the app again. The same issue occurs however, I’m able to pass the challenge.
Any thoughts as to how I can resolve this issue or is this more on FCC’s end?
I don’t believe there was a “Done” button only an “Import” one, I tried to go back a step to when I initially imported the boilerplate and that’s what I currently see. I even tried to create a new Replit using this boilerplate and the same error occurred.
If you use Replit, follow these steps to set up the project:
Start by importing the project on Replit.
Next, you will see a .replit window.
Select Use run command and click the Done button.
Edit: Your run command in the .replit file doesn’t look correct run = ["node", "index.js"] it should be run = "npm run start"
In the top right of the file explorer use the three dots and make sure it is set to show hidden files. Then edit the .replit file to use the run command I posted above.
This is how the content of the .replit file looks on a fresh import.
modules = ["nodejs-18:v3-20230608-f4cd419"]
hidden = [".config", "package-lock.json"]
run = "npm run start"
[nix]
channel = "stable-23_05"
[deployment]
run = ["sh", "-c", "npm run start"]
deploymentTarget = "cloudrun"
ignorePorts = false
I tried that by creating a new instance with the boilerplate, doing that seemed to have resolved the issue partially. That config file appears to match your screenshot however, I am getting the following error on the host view.
Understood, however, I can see there is an index.html page in the views folder. Shouldn’t it be displaying that page to complete the last challenge of the “Basic Node and Express” section?
I have gone back through each section as I realized there was code that is needed to continue further on. I’m on the last section now and running into the values received from the POST being “undefined.” I’m assuming there is something I’m missing or just not quite understanding fully. Here is my code:
I am now able to pass the challenge the code pasted above. For some reason the undefined value was shown through the host on Replit but not when I opened it from its own tab.