Skip to content
New issue

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

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

Already on GitHub? # to your account

"Package path ./esm/config/templates/requestAsyncStorageShim.js is not exported from package" with latest Next.js canary releases #13925

Closed
3 tasks done
mrmckeb opened this issue Oct 10, 2024 · 5 comments · Fixed by #13928
Assignees
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK

Comments

@mrmckeb
Copy link

mrmckeb commented Oct 10, 2024

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

8.33.1

Framework Version

Next.js 15.0.0-canary.181+

Link to Sentry event

No response

Reproduction Example/SDK Setup

Error when building:

Module not found: Package path ./esm/config/templates/requestAsyncStorageShim.js is not exported from package /vercel/path0/apps/[app-name]/node_modules/@sentry/nextjs (see exports field in /vercel/path0/apps/[app-name]/node_modules/@sentry/nextjs/package.json)

Steps to Reproduce

Use @sentry/nextjs in a project running canary 15.0.0-canary.181 or higher.

Expected Result

Builds without errors.

Actual Result

Fails to build.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Oct 10, 2024
@github-actions github-actions bot added the Package: nextjs Issues related to the Sentry Nextjs SDK label Oct 10, 2024
@mrmckeb
Copy link
Author

mrmckeb commented Oct 10, 2024

I did find an older, resolved issue related to this:
#9134

And the fix was here:
https://github.com/getsentry/sentry-javascript/pull/9126/files

@Lms24
Copy link
Member

Lms24 commented Oct 10, 2024

Hi @mrmckeb thanks for reporting! You're right, this is a regression because we changed the package-internal directory structure a while ago, specifically we added the build dir as the most top-level dir. I opened #13928 to fix this.

@Lms24
Copy link
Member

Lms24 commented Oct 10, 2024

Huh interestingly enough, our canary tests also caught this (internal link). I think the fix should address this but I wonder if there's more to the story. Looks like this went unnoticed previously.

lforst pushed a commit that referenced this issue Oct 10, 2024
…#13928)

Looks like we missed adding the `build` dir to the template path of
`requestAsyncStorageShim` in the NextJS SDK when we changed the
package-internal directory structure a while ago (IIRC this was pre-v8
but not sure actually)

I'm a bit surprised that this works at all, given we use `exports`
conditions and this is a path to a specific file not covered by any
`exports` entry. But I guess webpack can handle this still.

EDIT: Well turns out, this doesn't work. We'll need to add the `exports`
entries.

fixes #13925

closes #13926
closes #13927
@mrmckeb
Copy link
Author

mrmckeb commented Oct 10, 2024

Thank you!

Copy link
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #13928, which was included in the 8.34.0 release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants