twilio / twilio-video-app-react

A collaboration application built with the twilio-video.js SDK and React.js
Apache License 2.0
1.81k stars 728 forks source link

Token endpoint not found. Netlify deploy #623

Closed DCSivira closed 2 years ago

DCSivira commented 2 years ago

Describe the bug The applications throws the error "Unexpected token < in JSON at position 0" when trying to join a room. The inspector throws error 404 at /token:1.

To Reproduce Steps to reproduce the behavior:

  1. Build the application with npm run build
  2. Create a new site and Drag a Drop the build folder in Netlify, wait for deploy to finish
  3. Enter the app, fill Your Name field and Room Name field and continue.
  4. Press Join Now Button

Expected behavior The applications should listen /token and get the user inside The room

Screenshots 2021-12-17 16 59 00 vibrant-euclid-26faa2 netlify app 899f2db35fd5

2021-12-17 16 59 26 vibrant-euclid-26faa2 netlify app 661efc25feac

Environment (please complete the following information):

Additional context The applications runs without problems locally. All needed environment variables where added in Netlify

timmydoza commented 2 years ago

Hi @DCSivira - thanks for the issue!

Based on the steps that you shared, it looks like this app's token server isn't being run. In order for the /token endpoint to return a token, a server must be running in order to handle that request.

If you're only moving the build folder over to Netlify, then it sounds like there is not a server running anywhere. Is Netlify doing anything about installing packages with npm install? It is running any npm scripts? Are you doing anything with the code in the /server directory.

If you could please share more details with us about your deployment process, then maybe we can find a way to get this token server running on Netlify. Without the token server, this app can't function.

Thanks again for reaching out!

olipyskoty commented 2 years ago

Hi @DCSivira I will be closing this due to inactivity. Please let us know if you are still having trouble and we will reopen this issue. Thank you!