So I'm trying to make a function of a class I made async, but webpack gives me an error when compiling the class.
My code would be something like this:
class MyClass {
constructor(apiService) {
this._apiService = apiService;
}
async updateInformation() {
await this._apiService.updateInformation();
// .. do more stuff I have to do
}
}
The error that webpack gives me is:
Module build failed: SyntaxError: Unexpected token
(The Unexpected token points to the 'u' after async)