codedocu.de

Javascript Error: Uncaught (in promise) ReferenceError: response is not defined

 

Error Message

Uncaught (in promise) ReferenceError: response is not defined

 

 

Wrong code:

fetch("http://localhost:3000/articles/" + this.idarticle)

        .then(

          response.json()         

        )

 

Solution: Create an Arrow-Function

      fetch("http://localhost:3000/articles/" + this.idarticle)

        .then(response => response.json()          

        )

Oder (param) => expression

      fetch("http://localhost:3000/articles/" + this.idarticle)

        .then((response) => response.json()          

        )

 

 

Javascript Error: Uncaught (in promise) ReferenceError: response is not defined


Software Entwicklung Stuttgart Nürtingen
Suche Projekte C#, WPF, Windows App,ASP.Net, vb.Net, WinForms, SQL Server, Access, Excel