Closed CubE135 closed 2 years ago
Your are getting CORS errors because you forgot to set the .env file inside the server directory (./packages/server).
Create an .env file inside the server directory and add the environment variables NODE_ENV and JWT_SECRET. Both environment variables are only needed during the development. NODE_ENV needs to be set to avoid CORS errors because the UI is running on its own server by the Vue CLI. If the JWT_SECRET is not set, the server would automatically create a new one on every restart/hot reload.
Thats what i thought at first, but i actually did add the .env file:
Sorry but I cannot reproduce the problem on my machine. There are a few steps you could try.
Sadly, none of these helped.
But i managed to get it to work by doing this in the ./packages/server/app.js:
For now, this is ok for me, but it seems like the .env file is not read properly. At least, when i console.log(process.env) it lists all my windows Environment Variables but not the ones from the .env file.
Weird. The env file is read by the dotenv module on line 1 in app.js. I have setup the project a second time on another machine (Windows) and there is no problem either. Maybe there is a permission problem on your machine or there is some antivirus software which is blocking the process of reading the file.
I just tried to setup the Development version of ts3-manager. Sadly, after installing everything and running "npm run dev" in the project root, i open "localhost:8080" only to see this error:![image](https://user-images.githubusercontent.com/8761463/174905216-15589641-f45d-4a96-920e-da601a3f741a.png)
According to the console, besides some deprecation warnings and sass warning, everything seems fine:![image](https://user-images.githubusercontent.com/8761463/174905315-f2f5298f-5602-45ab-b0cb-f6cd6aad00c1.png)
Am i doing something wrong? I followed this guide: https://www.ts3.app/guide/Developers.html#get-started