joni1802 / ts3-manager

A modern web interface for maintaining Teamspeak3 servers
https://www.ts3.app
MIT License
190 stars 23 forks source link

xhr poll error #73

Closed CubE135 closed 2 years ago

CubE135 commented 2 years ago

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

According to the console, besides some deprecation warnings and sass warning, everything seems fine: image

Am i doing something wrong? I followed this guide: https://www.ts3.app/guide/Developers.html#get-started

joni1802 commented 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.

CubE135 commented 2 years ago

Thats what i thought at first, but i actually did add the .env file: image

joni1802 commented 2 years ago

Sorry but I cannot reproduce the problem on my machine. There are a few steps you could try.

CubE135 commented 2 years ago

Sadly, none of these helped. But i managed to get it to work by doing this in the ./packages/server/app.js: image 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.

joni1802 commented 2 years ago

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.