Open alperen-bircak opened 3 weeks ago
Hello, thanks for writing!
What are the versions of @sentry/nextjs
and @sentry/integrations
in your package.json and your lock file?
You can quickly grep it with the following example commands:
grep -i '@sentry/nextjs' package.json
grep -i '@sentry/nextjs' yarn.lock
(for yarn)
As we included the integration to @sentry/nextjs
in a later release, you could also do this:
@sentry/integrations
from your package.json
@sentry/nextjs
to the latest version of v7@sentry/nextjs
Hi, thanks for answering. When I import the itnegration from the @sentry/nextjs
and use it like below:
import * as Sentry from "@sentry/nextjs";
...
integrations: [Sentry.replayIntegration(), Sentry.consoleIntegration()],
...
I get the following error:
Attempted import error: 'consoleIntegration' is not exported from '@sentry/nextjs' (imported as 'Sentry').
My sentry version is 7.113.0
. Is there soething else you mean by "Import the integration from @sentry/nextjs"?
Thanks for your attention.
You want Sentry.captureConsoleIntegration()
, not Sentry.consoleIntegration()
- the latter only exists for node, while captureConsole is available in browser and node.
Could you verify if the steps outlined above, plus using Sentry.captureConsoleIntegration()
, works for you now?
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.105.0
Framework Version
13.4.19
Link to Sentry event
No response
SDK Setup
// This file configures the initialization of Sentry on the client. // The config you add here will be used whenever a users loads a page in their browser. // https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from "@sentry/nextjs"; import { captureConsoleIntegration } from "@sentry/integrations";
Sentry.init({ dsn: "https://2a75dde0ac4fbfcadf73320cd05cb65a@o4507152635658240.ingest.de.sentry.io/4507152692609104",
});
Steps to Reproduce
Expected Result
Console errors to be captured and typescript to not throw an error.
Actual Result
Typescript error last three lines. `Types of property 'attachmentType' are incompatible.
Type 'string | undefined' is not assignable to type 'AttachmentType | undefined'.
Type 'string' is not assignable to type 'AttachmentType | undefined'.`