1

When we make changes to a function in the express server, what is the right way to update using the AWS Amplify CLI?

For example I have a function like this:

app.get('/customers', function(req, res) {...}

And initially after the first push it works.

Then after editing and running push again I get this error:

core.js:6210 ERROR Error: Uncaught (in promise): Error: Network Error
Error: Network Error
    at createError (createError.js:16)
    at XMLHttpRequest.handleError [as __zone_symbol__ON_PROPERTYerror] (xhr.js:83)
    at XMLHttpRequest.wrapFn (zone-evergreen.js:1218)
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Object.onInvokeTask (core.js:41709)
    at ZoneDelegate.invokeTask (zone-evergreen.js:398)
    at Zone.runTask (zone-evergreen.js:167)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:480)
    at invokeTask (zone-evergreen.js:1621)
    at XMLHttpRequest.globalZoneAwareCallback (zone-evergreen.js:1647)
    at resolvePromise (zone-evergreen.js:798)
    at zone-evergreen.js:705
    at rejected (tslib.es6.js:72)
    at ZoneDelegate.invoke (zone-evergreen.js:364)
    at Object.onInvoke (core.js:41731)
    at ZoneDelegate.invoke (zone-evergreen.js:363)
    at Zone.run (zone-evergreen.js:123)
    at zone-evergreen.js:857
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Object.onInvokeTask (core.js:41709)

Upon getting that I tried running amplify update api and the amplify push, but I still get that error.

If I delete the API with amplify remove api and then amplify push and then recreate the API, it works.

Thoughts?

Also is there a way to troubleshoot the network error?

Ole
  • 41,793
  • 59
  • 191
  • 359

1 Answers1

1

OK - If not updating the path or adding a path then all that is needed is amplify push. This works when adding more dependencies as well.

If we add more paths, then we need to run amplify update and then amplify push.

Ole
  • 41,793
  • 59
  • 191
  • 359