Skip to content

Ember | Fix TypeScript error on InitSentryForEmber - #3802

Merged
kamilogorek merged 1 commit into
getsentry:masterfrom
GabrielCousin:patch-1
Jul 13, 2021
Merged

kamilogorek merged 1 commit into
getsentry:masterfrom
GabrielCousin:patch-1

Conversation

@GabrielCousin

@GabrielCousin GabrielCousin commented Jul 13, 2021 •

Copy link
Copy Markdown
Contributor

Hey there,

Thank you for the hard work fixing the types publications with the Ember addon.
While testing 6.9.0, I found a new bug which was (I think) easy to address, so here is a PR for this.

// in app/app.ts
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'search/config/environment';
import { InitSentryForEmber } from '@sentry/ember';

InitSentryForEmber();

export default class App extends Application {
// ...
}

TypeScript is reporting the following error:

app/app.ts:7:1 - error TS2554: Expected 1 arguments, but got 0.

7 InitSentryForEmber();
  ~~~~~~~~~~~~~~~~~~~~

node_modules/@sentry/ember/index.d.ts:5:44
    5 export declare function InitSentryForEmber(_runtimeConfig: BrowserOptions | undefined): void;
                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An argument for '_runtimeConfig' was not provided.

Found 1 error.

The other option is to explicitly pass undefined as the first argument.
Let me know if there is anything else I can help with!

@kamilogorek
kamilogorek enabled auto-merge (squash) July 13, 2021 13:38
@kamilogorek
kamilogorek disabled auto-merge July 13, 2021 13:38
@kamilogorek
kamilogorek enabled auto-merge (squash) July 13, 2021 13:39
@kamilogorek

Copy link
Copy Markdown
Contributor

Thanks

@AbhiPrasad
AbhiPrasad requested a review from k-fish July 13, 2021 15:14

@k-fish k-fish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, missed that optional, thanks for the PR 👍

@kamilogorek
kamilogorek merged commit 778ad8b into getsentry:master Jul 13, 2021
@GabrielCousin
GabrielCousin deleted the patch-1 branch July 20, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants