'When i send a get request to a server on node js i get "Unexpected token in JSON at position 0"

When i started using node js everything was good and running smoothly. As soon as i tryed to connect to mongoDB the - "Unexpected token in JSON at position 0 at JSON.parse() " started to appeared every single time i was sending a get request from postman to the server. In addition, files that were already worked perfectly are no longer running and dont return any data, but as well return the same error of - "Unexpected token in JSON at position 0 at JSON.parse ()". The error dont refers to any specific line in the code. what may cause this error ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source