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

Attempted import error: 'wrapGetServerSidePropsWithSentry' is not exported from '@sentry/nextjs' #7254

Closed
3 tasks done
mcmxcdev opened this issue Feb 22, 2023 · 9 comments · Fixed by #7256
Closed
3 tasks done
Assignees
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug

Comments

@mcmxcdev
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/nextjs

SDK Version

7.38.0

Framework Version

React 18.2.0

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

No idea

Expected Result

No warning to pop up. It seems though that it doesn't break anything.

Actual Result

> nx run app:build:production

info  - Skipping validation of types
info  - Skipping linting
info  - Creating an optimized production build  
warn  - Compiled with warnings

../../libs/shared/utils/src/lib/session.ts
Attempted import error: 'wrapGetServerSidePropsWithSentry' is not exported from '@sentry/nextjs' (imported as 'wrapGetServerSidePropsWithSentry').

@lforst
Copy link
Member

lforst commented Feb 22, 2023

Thanks for writing in, I pushed a fix: #7256

@lforst lforst added Status: Confirmed Package: nextjs Issues related to the Sentry Nextjs SDK and removed Status: Untriaged labels Feb 22, 2023
@lforst lforst self-assigned this Feb 22, 2023
@jvidalv
Copy link

jvidalv commented Feb 28, 2023

I'm still experiencing this with latest version (7.39.0):

image

And this goes on for every page in the site.

The latest version that works (tested all of them) is this one 7.31.1.

We are using pnpm and pnpm workspaces.

@lforst
Copy link
Member

lforst commented Feb 28, 2023

@jvidalv It is super unlikely that this is still happening in the new version. Can you clear your pnpm cache and try again?

@jvidalv
Copy link

jvidalv commented Feb 28, 2023

Hi @lforst , thanks for the quick reply.

I did indeed use: pnpm store prune, and also deleted node_modules and then I did run it again (prune). It didn't fix the issue that I shared.

As mentioned the latest version that seems to work is 7.31.1.

@lforst
Copy link
Member

lforst commented Feb 28, 2023

@jvidalv got it. Can you share a reproduction example? Just something we can clone or a https://stackblitz.com/ would be enough.

@jvidalv
Copy link

jvidalv commented Mar 20, 2023

@lforst finally found the root cause of the error, any page that has:

export const config = {
  runtime: 'experimental-edge'
}

Configured, makes the build fail with versions bigger that 4.31 with the error that I shared.

@lforst
Copy link
Member

lforst commented Mar 20, 2023

@jvidalv woah didn't even know you could do that. Would you mind creating a separate issue for this so we can fix it? Thanks!

@jvidalv
Copy link

jvidalv commented Mar 20, 2023

#7522

@lforst
Copy link
Member

lforst commented Mar 21, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants