Failed to load user data
I'm a NOOB to Wasp and not a developer.
I ran these commands...
π --- Listening for file changes... ----------------------------------------------
π --- Starting up generated project... -------------------------------------------
[ Client ] > project1@0.0.0 start
[ Client ] > vite
[ Client ]
[ Server ] > server@0.0.0 watch
[ Server ] > nodemon --exec 'npm run bundle-and-start exit 1'
[ Server ]
[ Server ] [nodemon] 2.0.22
[ Server ] [nodemon] to restart at any time, enter
rs
[ Server ] [nodemon] watching path(s): src//* ../../../src//* .env
[ Server ] [nodemon] watching extensions: ts,mts,js,mjs,json
[ Server ] [nodemon] starting `npm run bundle-and-start exit 1
[ Server ]
[ Server ] > server@0.0.0 bundle-and-start
[ Server ] > npm run bundle && npm run start
[ Server ]
[ Server ]
[ Server ] > server@0.0.0 bundle
[ Server ] > tsc --build && rollup --config --silent
[ Server ]
[ Client ]
[ Client ] VITE v6.3.5 ready in 925 ms
[ Client ]
[ Client ] β Local: http://localhost:3000/
[ Client ] β Network: http://2.58.201.86:3000/
[ Client ] β press h + enter to show help
[ Client!] Error: spawn xdg-open ENOENT
[ Client!] at ChildProcess._handle.onexit (node:internal/child_process:285:19)
[ Client!] at onErrorNT (node:internal/child_process:483:16)
[ Client!] at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[ Server ]
[ Server ] > server@0.0.0 start
[ Server ] > node --enable-source-maps -r dotenv/config bundle/server.js
[ Server ]
[ Client!] (node:6932) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
[ Client!] (Use
node --trace-warnings ...` to show where the warning was created)
[ Server ] π "Email and password" auth initialized
[ Server ] Server listening on port 3001
...and get this error:
Failed to load user data. Try refreshing the page.
Details: Network Error
3 Replies
Hi @JoshFialkoff. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information in your logs and the knowledge sources, the error "Failed to load user data. Try refreshing the page. Details: Network Error" is most likely caused by a connectivity issue between the frontend (running on port 3000) and the backend server (running on port 3001).
Here are some common causes and troubleshooting steps, as discussed in the Wasp community:
1. Backend Not Running or Not Reachable
Make sure the backend server is actually running and listening on port 3001. Your logs show "Server listening on port 3001", so this seems fine, but double-check that nothing else is using this port and that the server process is healthy. 2. CORS or Environment Variable Misconfiguration
If you are running Wasp in a cloud environment (like Gitpod, Docker, or a VM), you may need to set environment variables so the frontend knows how to reach the backend. For example, in Gitpod, you need to set
Ensure that both ports 3000 and 3001 are open and accessible. If you are using a service like Gitpod or Docker, you may need to explicitly expose these ports. 4. Check for Server Errors
Look at the terminal where the backend is running for any errors. Sometimes the backend may crash or fail to connect to the database, which can also cause network errors on the frontend. 5. Browser Console and Network Tab
Open your browser's developer tools (usually F12), go to the Network tab, and look for failed requests. This can give you more details about what is failing and why. 6. "xdg-open ENOENT" Error
The error
Make sure the backend server is actually running and listening on port 3001. Your logs show "Server listening on port 3001", so this seems fine, but double-check that nothing else is using this port and that the server process is healthy. 2. CORS or Environment Variable Misconfiguration
If you are running Wasp in a cloud environment (like Gitpod, Docker, or a VM), you may need to set environment variables so the frontend knows how to reach the backend. For example, in Gitpod, you need to set
WASP_WEB_CLIENT_URL
in .env.server
to your frontend URL and REACT_APP_API_URL
in .env.client
to your backend URL. If these are not set correctly, the frontend may not be able to communicate with the backend, resulting in a network error. This is a common issue in cloud or remote environments, but can also happen locally if the URLs are misconfigured Template Signup Network Error > Answers Part 1, Template Signup Network Error > Answers Part 4.
3. Port AccessibilityEnsure that both ports 3000 and 3001 are open and accessible. If you are using a service like Gitpod or Docker, you may need to explicitly expose these ports. 4. Check for Server Errors
Look at the terminal where the backend is running for any errors. Sometimes the backend may crash or fail to connect to the database, which can also cause network errors on the frontend. 5. Browser Console and Network Tab
Open your browser's developer tools (usually F12), go to the Network tab, and look for failed requests. This can give you more details about what is failing and why. 6. "xdg-open ENOENT" Error
The error
[ Client!] Error: spawn xdg-open ENOENT
is not critical; it just means the system tried to open a browser window automatically but couldn't find the right tool (common on headless servers or minimal Linux installs). This does not affect the app's functionality Whenever I run wasp db migrate-dev
on my ec2 instance... > Answers Part 4.
Summary of what to check:
- Is the backend server running and healthy on port 3001?
- Are the environment variables for API URLs set correctly?
- Are both ports 3000 and 3001 accessible from your browser?
- Are there any errors in the backend terminal?
- What does the browser's Network tab show for failed requests?
If you are running locally and still see this error, try stopping all Wasp processes, running wasp clean
, and then wasp start
again, as this can sometimes resolve environment or build issues nothing shows up in localhost:3000 after wasp start > Answers Part 1.
If you provide more details about your environment (local, Docker, Gitpod, etc.), I can give more targeted advice.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @JoshFialkoff, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Hey @JoshFialkoff, did you apply the migration to the database first?
After generating a starter template you should do
wasp db migrate-dev
command before trying to do wasp start
.
Should be mentioned in the terminal output after you use wasp new
.I didnβt see that in what I pasted. I will go back and create a new project and make sure I do that. Thank you for your help!
This is working now. Thank you for your help!