question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript types for existing Raven plugins

See original GitHub issue

What is the current behavior?

I try to add raven to vue project that is using typescript.

import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue';
import Vue from 'vue';

however, this ends up with error as typescript types for raven do not extend to plugins

Error at src/sentry.ts:2:27: Could not find a declaration file for module 'raven-js/plugins/vue'. '/..../node_modules/raven-js/plugins/vue.js' implicitly has an 'any' type.

Raven 3.22.1 is used from npm package.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
kamilogorekcommented, Sep 11, 2018

All integrations in new SDK are completely written in TypeScript - https://github.com/getsentry/sentry-javascript/tree/master/packages/browser/src/integrations/pluggable so this shouldn’t be an issue anymore.

3reactions
marocchinocommented, Jun 21, 2018

I declare module like this in our own project.

declare module 'raven-js/plugins/vue' {
  import Vue from 'vue';
  import { RavenStatic } from 'raven-js';
  function vuePlugin(raven: RavenStatic, vue: Vue): RavenStatic;
  export = vuePlugin;
}

This definition is fine for me, but not for other users who do not use Vue. Unless we solve this dependency problem, it’s hard to put types in plugins.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@types/raven - npm
Start using @types/raven in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >
Integrations | Sentry Documentation
Integrations extend the functionality of Raven.js to cover common libraries and environments automatically using simple plugins.
Read more >
Documentation - Global: Plugin - TypeScript
A global-modifying module alters existing values in the global scope when they are imported. For example, there might exist a library which adds...
Read more >
Grails Plugins
A portal for searching Grails plugins! ... 1.1 published May 15, 2019 by purpleraven ... The jaxrs-integration-test plugin provides classes to help with ......
Read more >
Serverless Sentry - Serverless Framework: Plugins
This Serverless plugin simplifies integration of Sentry with the popular Serverless ... For more details about the different configuration options available ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found