Base solution for your next web application
Open Closed

Issue while Deploying #8429


User avatar
0
christianharo created

Hello,

Having an issue ? The App runs fine in developpment and crashes when deployed.

I'm using ASP.NET CORE & Angular V.8.0.0. ( latest)

From IIS I can start the backend and it runs ok.

But when I launch the app from the browser, here is the error I get this error :

ERROR SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at XMLHttpRequest.o.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (main.002842262ec102d6dcb0.js:1)
at XMLHttpRequest.I (polyfills.e4561eaaef4f193a51de.js:1)
at t.invokeTask (polyfills.e4561eaaef4f193a51de.js:1)
at Object.onInvokeTask (main.002842262ec102d6dcb0.js:1)
at t.invokeTask (polyfills.e4561eaaef4f193a51de.js:1)
at e.runTask (polyfills.e4561eaaef4f193a51de.js:1)
at e.invokeTask [as invoke] (polyfills.e4561eaaef4f193a51de.js:1)
at b (polyfills.e4561eaaef4f193a51de.js:1)
at XMLHttpRequest.m (polyfills.e4561eaaef4f193a51de.js:1)


7 Answer(s)
  • User Avatar
    1
    christianharo created

    Nevermind. My fault!

  • User Avatar
    0
    optixdev created

    Hi christianharo, how did you solve this issue as I am facing the same problem.

  • User Avatar
    0
    christianharo created

    Hi optixdev. My just was a typo on the configuration "appconfig.json file. I was adding a "/" at the end of the remoServicebaseUrl. What cause the client to not find the server.

  • User Avatar
    0
    optixdev created

    Christainharo - Thanks for the reply.

    I am still facing the same issue, can you please share/copy the appconfig.json file her?

    Thanks
    ODev

  • User Avatar
    0
    christianharo created

    {
    "remoteServiceBaseUrl": "http://localhost:22742",
    "appBaseUrl": "http://localhost:4200",
    "localeMappings": {
    "angular": [
    {
    "from": "pt-BR",
    "to": "pt"
    },
    {
    "from": "zh-CN",
    "to": "zh"
    },
    {
    "from": "he-IL",
    "to": "he"
    },
    {
    "from": "es-MX",
    "to": "es"
    },
    {
    "from": "vi",
    "to": "en"
    }
    ],
    "moment": [
    {
    "from": "es-MX",
    "to": "es"
    },
    {
    "from": "zh-Hans",
    "to": "zh-cn"
    },
    {
    "from": "vi",
    "to": "en-gb"
    }
    ]
    }
    }

  • User Avatar
    0
    optixdev created

    christianharo... Is this server copy or localhost?

  • User Avatar
    0
    Simonlum created

    Hi optixdev. My just was a typo on the configuration "appconfig.json file. I was adding a "/" at the end of the remoServicebaseUrl. What cause the client to not find the server.

    Good , it resolved my question。cant add ‘/’ at the end of url