I went through the contact-manager tutorial and everything was working just fine.
When I tried to run it again after a week it shows a blank page and this error in my console:
Unhandled rejection ReferenceError: api is not defined
I have not changed any files in the project, so I have no idea why this happend.
I have to mention that several other projects that I have started has also been crashing when I tried to run them the day after(without making any changes at all).
Seems like you changed build tool either by upgrading version or switch bundler. Different bundlers resolve project src in different ways, that could be why it couldnt bundle the api. Another possibility is you have circular references that caused the export to become undefined. Either way probably its not a simple fix.
I would go from api class to remove some imports that potentially cause the circular references
Edit: just had a look at the exception, it seems like somewhere in yur code, you are using api without defining it in the scope. That would be enough to track down the error.
canDeactivate() {
if (!areEqual(this.originalContact, this.contact)){
return confirm(‘You have unsaved changes. Are you sure you wish to leave?’);
}