Base solution for your next web application
Open Closed

Angular + .Net Core (separate solution deployed on Azure) - ERROR SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse #8445


User avatar
1
optixdev created

How to fix this?

main.2ad1e9e0e64faafe47b6.js:1 ERROR SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.o.onreadystatechange [as _zone_symbol__ON_PROPERTYreadystatechange] (main.2ad1e9e0e64faafe47b6.js:1) at XMLHttpRequest. (polyfills.ff5db258a5fdbd0d317c.js:1) at t.invokeTask (polyfills.ff5db258a5fdbd0d317c.js:1) at Object.onInvokeTask (main.2ad1e9e0e64faafe47b6.js:1) at t.invokeTask (polyfills.ff5db258a5fdbd0d317c.js:1) at e.runTask (polyfills.ff5db258a5fdbd0d317c.js:1) at e.invokeTask [as invoke] (polyfills.ff5db258a5fdbd0d317c.js:1) at p (polyfills.ff5db258a5fdbd0d317c.js:1) at XMLHttpRequest.h (polyfills.ff5db258a5fdbd0d317c.js:1) Ei @ main.2ad1e9e0e64faafe47b6.js:1


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Can you check the logs of the application?

  • User Avatar
    0
    optixdev created

    Its running fine locally but its not working on Azure

  • User Avatar
    0
    maliming created
    Support Team

    Ok , Can you check the log files of the application on Azure?

  • User Avatar
    0
    Hammer created

    Hi there, did you find a solution to your problem? I think I have the same.

  • User Avatar
    0
    beelineweb created

    I'm having the exact same problem - I've seen this error before but there's no way to dig into it\nothing really useful or obvious in the logs, either.

  • User Avatar
    0
    henryand created

    I recently had this error. the error means that your Angular app did not compile properly. when publishing to Azure, AOT is on for optimization but off for running locally. For us, there were Angular errors, mostly html controls bound to functions that did not exist in the corresponding TypeScript file, that broke the build for publishing to Azure. Once we fixed the bindings, the app published and ran fine.

    hope this helps.