I am using Nextjs v10. I want to use CDN script tag approach to log and monitor the application.
To log the JS error, I build Error boundary class and I wanna log JS error to cloudwatch RUM
declare function cwr(operation: string, payload: any): void;
What is your general inquiry?
I am using Nextjs v10. I want to use CDN script tag approach to log and monitor the application. To log the JS error, I build Error boundary class and I wanna log JS error to cloudwatch RUM
declare function cwr(operation: string, payload: any): void;
class App extends Component { ... componentDidCatch(error, info) { console.log(error); cwr('recordError', error); }; ... }
But, I am getting error while building the application. It throws error at declare Syntax error: Unexcepted token, expected ";"