sentry-javascript: Typing errors on 3.13.0 release

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

The last release (3.13.0) seems to have broken some type definitions.

In a .ts file compiled with tsc

import * as Raven from 'raven-js';
Raven.config(/*..*);

In a get ->

error TS2339: Property 'config' does not exist on type 'typeof ".../node_modules/raven-js/typescri...'

I see the same error in Visual Code.

What is the expected behavior?

This was working fine in 3.12. I saw in the release page, that many changes occurred during the last release on ts files so I might not using it correctly anymore. Thanks for your time, and do not hesitate if you need more information.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 19 (15 by maintainers)

Most upvoted comments

3.13.1 is published. Keeping this open because I want to solve this TypeScript problem properly – and hopefully for the last time.

the reason is your .d.ts describes an ES module, but your source code is a CJS module

I have the same issue. The code appears to be doing module.exports = Raven but the typescript is using export default so they seem to be incompatible unless I am missing something? Perhaps there is a setting in typescript that allows for this? The raven typescript tests appear to use import ... from ... so perhaps it is possible to make it work?