Open
Description
I followed the documentation to integrate Rollbar into my web application.
After adding the Rollbar plugin to my Vue application, I am always given the following error (note that I am using ESNext):
Loading failed for the module with source “http://localhost:5173/node_modules/.vite/deps/rollbar.js?v=1d483b56”.
Steps taken
- (
rollbar.ts
) I have followed the TypeScript steps to import Rollbar and create the Rollbar instance:
import { App } from "vue";
import Rollbar from "rollbar";
const rollbar = new Rollbar({
accessToken: 'myToken',
captureUncaught: true,
captureUnhandledRejections: true
});
export const RollbarPlugin = {
install(app: App) {
app.config.errorHandler = (error: any, instance, info) => {
console.log("error");
rollbar.error(error, { vueComponent: instance, info });
};
app.provide('rollbar', rollbar);
},
};
- (
main.ts
) I have correctly added the RollbarPlugin to my application:
import { RollbarPlugin } from "@/rollbar";
const app = createApp(App);
app.use(RollbarPlugin);