Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Error in published Angular solution in Azure after upgrade. #4573


User avatar
0
affern created

After I upgraded my Angular solution to version 5 and published to Azure, I get this error:

ERROR Error: Uncaught (in promise): ReferenceError: EditionSelectDto is not defined ReferenceError: EditionSelectDto is not defined at <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:1430:42">https://mysitefrontwebapp.azurewebsites ... js:1430:42</a> at Object.../../../../../src/account/payment/paypal/paypal.component.ts (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:1443:2">https://mysitefrontwebapp.azurewebsites ... .js:1443:2</a>) at webpack_require (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/inline.bundle.js:55:30">https://mysitefrontwebapp.azurewebsites ... e.js:55:30</a>) at Object.../../../../../src/account/payment/payment-gateways.component.ts (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:1239:83">https://mysitefrontwebapp.azurewebsites ... js:1239:83</a>) at webpack_require (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/inline.bundle.js:55:30">https://mysitefrontwebapp.azurewebsites ... e.js:55:30</a>) at Object.../../../../../src/account/account.module.ts (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:257:95">https://mysitefrontwebapp.azurewebsites ... .js:257:95</a>) at webpack_require (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/inline.bundle.js:55:30">https://mysitefrontwebapp.azurewebsites ... e.js:55:30</a>) at <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/main.bundle.js:33:10">https://mysitefrontwebapp.azurewebsites ... e.js:33:10</a> at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7569:26">https://mysitefrontwebapp.azurewebsites ... js:7569:26</a>) at Object.onInvoke (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/vendor.bundle.js:123266:33">https://mysitefrontwebapp.azurewebsites ... :123266:33</a>) at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7568:32">https://mysitefrontwebapp.azurewebsites ... js:7568:32</a>) at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7329:43">https://mysitefrontwebapp.azurewebsites ... js:7329:43</a>) at <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7962:57">https://mysitefrontwebapp.azurewebsites ... js:7962:57</a> at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7602:31">https://mysitefrontwebapp.azurewebsites ... js:7602:31</a>) at Object.onInvokeTask (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/vendor.bundle.js:123257:33">https://mysitefrontwebapp.azurewebsites ... :123257:33</a>) at <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:1430:42">https://mysitefrontwebapp.azurewebsites ... js:1430:42</a> at Object.../../../../../src/account/payment/paypal/paypal.component.ts (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:1443:2">https://mysitefrontwebapp.azurewebsites ... .js:1443:2</a>) at webpack_require (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/inline.bundle.js:55:30">https://mysitefrontwebapp.azurewebsites ... e.js:55:30</a>) at Object.../../../../../src/account/payment/payment-gateways.component.ts (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:1239:83">https://mysitefrontwebapp.azurewebsites ... js:1239:83</a>) at webpack_require (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/inline.bundle.js:55:30">https://mysitefrontwebapp.azurewebsites ... e.js:55:30</a>) at Object.../../../../../src/account/account.module.ts (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/account.module.chunk.js:257:95">https://mysitefrontwebapp.azurewebsites ... .js:257:95</a>) at webpack_require (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/inline.bundle.js:55:30">https://mysitefrontwebapp.azurewebsites ... e.js:55:30</a>) at <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/main.bundle.js:33:10">https://mysitefrontwebapp.azurewebsites ... e.js:33:10</a> at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7569:26">https://mysitefrontwebapp.azurewebsites ... js:7569:26</a>) at Object.onInvoke (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/vendor.bundle.js:123266:33">https://mysitefrontwebapp.azurewebsites ... :123266:33</a>) at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7568:32">https://mysitefrontwebapp.azurewebsites ... js:7568:32</a>) at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7329:43">https://mysitefrontwebapp.azurewebsites ... js:7329:43</a>) at <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7962:57">https://mysitefrontwebapp.azurewebsites ... js:7962:57</a> at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7602:31">https://mysitefrontwebapp.azurewebsites ... js:7602:31</a>) at Object.onInvokeTask (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/vendor.bundle.js:123257:33">https://mysitefrontwebapp.azurewebsites ... :123257:33</a>) at resolvePromise (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7914:31">https://mysitefrontwebapp.azurewebsites ... js:7914:31</a>) [angular] at resolvePromise (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7885:17">https://mysitefrontwebapp.azurewebsites ... js:7885:17</a>) [angular] at <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7962:17">https://mysitefrontwebapp.azurewebsites ... js:7962:17</a> [angular] at Object.onInvokeTask (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/vendor.bundle.js:123257:33">https://mysitefrontwebapp.azurewebsites ... :123257:33</a>) [angular] at drainMicroTaskQueue (<a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/polyfills.bundle.js:7795:35">https://mysitefrontwebapp.azurewebsites ... js:7795:35</a>) [<root>] at <anonymous> [<root>]

It works fine on my local computer, so something is missing in the build to prod.


9 Answer(s)
  • User Avatar
    0
    affern created

    If I comment out BuyComponent, UpgradeOrExtendComponent, PaymentGatewaysComponent and PayPalComponent in AccountModule, the page loads, but with these error messages:

    jquery.min.js:2 GET <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/fontawesome-webfont.af7ae505a9eed503f8b8.woff2">https://mysitefrontwebapp.azurewebsites ... f8b8.woff2</a> net::ERR_ABORTED jquery.min.js:2 GET <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/assets/metronic/libs/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.woff2">https://mysitefrontwebapp.azurewebsites ... ular.woff2</a> net::ERR_ABORTED jquery.min.js:2 GET <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/Simple-Line-Icons.0cb0b9c589c0624c9c78.woff2">https://mysitefrontwebapp.azurewebsites ... 9c78.woff2</a> net::ERR_ABORTED /fontawesome-webfont.fee66e712a8a08eef580.woff:1 GET <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/fontawesome-webfont.fee66e712a8a08eef580.woff">https://mysitefrontwebapp.azurewebsites ... ef580.woff</a> net::ERR_ABORTED GET <a class="postlink" href="https://mysitefrontwebapp.azurewebsites.net/assets/metronic/libs/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.woff">https://mysitefrontwebapp.azurewebsites ... gular.woff</a> net::ERR_ABORTED

    I followed these steps when I upgraded Angular from 4 to 5: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/commit/a0406c62c0afe8641acd0fc9f3a15697e5de1826">https://github.com/aspnetzero/aspnet-ze ... 97e5de1826</a>, and it works in development. I have the latest asp.net zero core 2.0 in backend, but a front-end solution from july 2017. What do I need to change after the angular upgrade? :?

  • User Avatar
    0
    affern created

    I tried to insert this in web.config, but it did'nt help:

    <staticContent> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> <mimeMap fileExtension=". WOFF2 " mimeType="application/font- WOFF2 " /> </staticContent>

  • User Avatar
    0
    alirizaadiyahsi created

    Check this for your latest error #4576

    Did you find a solution for your first issue?

  • User Avatar
    0
    affern created

    It solved it when I commented out BuyComponent, UpgradeOrExtendComponent, PaymentGatewaysComponent and PayPalComponent in AccountModule. But this is just a temporary solution. It is strange that it works in the development environment but not in production. Seems like my angular solution has not detected the relocation of any of the dto objects to application.shared in the back-end solution.

  • User Avatar
    0
    alirizaadiyahsi created

    After you change your backend, you should run nswag (angular/nswag/refresh.bat) to regenerate service.proxies.ts

  • User Avatar
    0
    affern created

    <cite>alirizaadiyahsi: </cite> After you change your backend, you should run nswag (angular/nswag/refresh.bat) to regenerate service.proxies.ts

    I run nswag every time after I have changes in my services, so this is not the solution to the problem. Or should I run nswag on the production server in Azure as well?

  • User Avatar
    0
    ismcagdas created
    Support Team

    @affern, no you must run it locally before publishing your Angular app. Does your service-proxies.ts file contains EditionSelectDto ?

  • User Avatar
    0
    affern created

    <cite>ismcagdas: </cite> @affern, no you must run it locally before publishing your Angular app. Does your service-proxies.ts file contains EditionSelectDto ?

    Yes, it does. But I think the problem is about caching in Azure. After my last upgrade it shows the old solution. But if i clear my cache in my browser it works. I don't have this problem in my development environment, so maybe it is some cache settings in Azure.

  • User Avatar
    0
    ismcagdas created
    Support Team

    I'm glad that it is solved :)