Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nextjs): Export Replay from index.server.ts to avoid TS error #6577

Merged
merged 1 commit into from Dec 19, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Dec 19, 2022

This PR fixes a TypeScript error when using the Replay integration exported from the NextJS SDK (>= 7.27.0). Because our SDK tells TS that it should import types from index.server.ts, TS doesn't find the Replay integration class although it's correctly exported from indext.client.ts.

Note: even without this change, Replay works in NextJS, it's just a TS error.

@reviewers: I tested this with a basic NextJS app and for me it works. However, if you have a few minutes and would like to give it a try with more sophisticated test apps, I'd appreciate it.

fixes #6574

@Lms24 Lms24 self-assigned this Dec 19, 2022
@Lms24 Lms24 force-pushed the lms-fix-nextjs-replay-export branch from fd8b0f1 to b3a047c Compare December 19, 2022 11:03
@Lms24 Lms24 changed the title fix(nextjs): Export Replay from index.server.ts to avoid build error fix(nextjs): Export Replay from index.server.ts to avoid TS error Dec 19, 2022
Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Fixed it for a TS Next.js app of mine and also doesn't seem to cause problems on Vercel 👍

@Lms24 Lms24 merged commit 6a275c0 into master Dec 19, 2022
@Lms24 Lms24 deleted the lms-fix-nextjs-replay-export branch December 19, 2022 13:44
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.

Exporting Replay from @sentry/nextjs
2 participants