Typescript < version 3.6.0
If you are using a version of Typescript less than 3.6.0 you can import Rollbar using the following syntax.
import * as Rollbar from 'rollbar';
Typescript = version 3.6.x
For any version of Typescript in 3.6.x you need to make sure
esModuleInterop is set in your Typescript options. Then you can import Rollbar using the following syntax.
import Rollbar from 'rollbar';
For versions, ES6, ES7, ES8, and ES9 use the following code example to import Rollbar.
// ES6, ES7, ES8, ES9 import Rollbar from "rollbar";
If you are using ES5, import Rollbar using this sample code snippet.
// ES5 var Rollbar = require('rollbar');
Updated 5 months ago