Skip to content

Commit 98ca08a

Browse files
docs: Change vue warning regarding logErrors (#1150)
* docs: Change vue warning regarding logErrors * Update src/collections/_documentation/platforms/javascript/vue.md Co-Authored-By: Tien "Mimi" Nguyen <[email protected]> * Update src/collections/_documentation/platforms/javascript/vue.md Co-Authored-By: Tien "Mimi" Nguyen <[email protected]>
1 parent e8787d2 commit 98ca08a

File tree

1 file changed

+17
-12
lines changed
  • src/collections/_documentation/platforms/javascript

1 file changed

+17
-12
lines changed

src/collections/_documentation/platforms/javascript/vue.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,28 @@ yarn add @sentry/integrations
2929
npm install @sentry/integrations
3030
```
3131

32+
Then add this to your `app.js`:
33+
34+
```javascript
35+
import Vue from 'vue'
36+
import * as Sentry from '@sentry/browser';
37+
import * as Integrations from '@sentry/integrations';
38+
39+
Sentry.init({
40+
dsn: '___PUBLIC_DSN___',
41+
integrations: [new Integrations.Vue({Vue, attachProps: true})],
42+
});
43+
```
44+
45+
Additionally, `Integrations.Vue` accepts a few different configuration options that let you change its behavior:
46+
3247
- Passing in `Vue` is optional, if you do not pass it `window.Vue` must be present.
3348
- Passing in `attachProps` is optional and is `true` if it is not provided. If you set it to `false`, Sentry will suppress sending all Vue components' props for logging.
3449
- Passing in `logErrors` is optional and is `false` if it is not provided. If you set it to `true`, Sentry will call original Vue's `logError` function as well.
3550

3651
{% capture __alert %}
37-
Please note that if you enable this integration Vue internally will not call `logError` due to a currently know limitation see: [GitHub Issue](https://github.com/vuejs/vue/issues/8433). This means that errors occurring in the Vue renderer will not show up in the developer console.
52+
Please note that if you enable this integration, Vue will not call its `logError` internally. This means that errors occurring in the Vue renderer will not show up in the developer console.
53+
If you want to preserve this functionality, make sure to pass the `logErrors: true` option.
3854
{% endcapture %}
3955

4056
{% include components/alert.html
@@ -43,17 +59,6 @@ Please note that if you enable this integration Vue internally will not call `lo
4359
level="warning"
4460
%}
4561

46-
```javascript
47-
import Vue from 'vue'
48-
import * as Sentry from '@sentry/browser';
49-
import * as Integrations from '@sentry/integrations';
50-
51-
Sentry.init({
52-
dsn: '___PUBLIC_DSN___',
53-
integrations: [new Integrations.Vue({Vue, attachProps: true})],
54-
});
55-
```
56-
5762
In case you are using the CDN version or the Loader, we provide a standalone file for every integration, you can use it
5863
like this:
5964

0 commit comments

Comments
 (0)