aws-observability / aws-rum-web

Amazon CloudWatch RUM Web Client
Apache License 2.0
114 stars 65 forks source link

[General Inquiry]: Cloudwatch CDN NextJS #522

Closed sivasankar169 closed 3 months ago

sivasankar169 commented 3 months ago

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 ";"

### Tasks
williazz commented 3 months ago
componentDidCatch(error, info) {
console.log(error);
cwr('recordError', error);
}; // remove this semicolon