Skip to content

Next.js Turbopack Support #8105

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

Open
Tracked by #85531
ryanolson-aumni opened this issue May 11, 2023 · 67 comments
Open
Tracked by #85531

Next.js Turbopack Support #8105

ryanolson-aumni opened this issue May 11, 2023 · 67 comments

Comments

@ryanolson-aumni
Copy link

ryanolson-aumni commented May 11, 2023

⚠️ This original post has been edited by @lforst to reflect the current status of Turbopack Support ⚠️

Important

This issue is tracking progress on Turbopack Support. If you find bugs or problems with the Sentry SDK in combination with Turbopack please open a separate issue. Thank you!

Problem Statement

Sentry should work in combination with Turbopack with all of its features.

Current Status (Last Update May 5, 2025)

Feature Support Notes
Next.js app compiles and runs without issues
Server-side instrumentation
Client-side instrumentation - Upgrade to SDK version 9.9.0 or greater
- Upgrade to Next.js canary 15.3.0-canary.8 or greater
- Add instrumentation-client.ts file with Sentry.init() call. (sentry.client.config.ts can be replaced with instrumentation-client.ts. It serves the same purpose.)
Release Injection - Upgrade SDK to version 9.11.0
Source Maps - Needs runAfterProductionCompile hook implemented in Next.js (done in Next.js 15.4.0-canary.19)
- Needs way to inject debug IDs into bundles implemented in Next.js
React Component Name Annotations - Needs way to transform code in Next.js
- Will likely not be possible for the forseeable future
@smeubank

This comment has been minimized.

@mdugue

This comment has been minimized.

@lforst

This comment has been minimized.

@smeubank

This comment has been minimized.

@lforst

This comment has been minimized.

@Stanzilla

This comment has been minimized.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Dec 14, 2023
@lforst

This comment has been minimized.

@leerob
Copy link

leerob commented Feb 10, 2024

It's also worth noting that the initial Turbopack support is for next dev, which is only for your local environment. next build support will come later 🙏

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 May 2, 2025
@s1gr1d s1gr1d mentioned this issue May 5, 2025
3 tasks
@coderrshyam
Copy link

When using turbopack in development mode, I encountered the following warning:

  ./node_modules/.pnpm/@sentry+node@9.18.0/node_modules/@sentry/node/build/cjs/sdk
Package import-in-the-middle can't be external.
The request import-in-the-middle matches serverExternalPackages (or the default list).
The package resolves to a different version when requested from the project directory (1.13.1) compared to the package requested from the importing module (1.13.2).
Make sure to install the same version of the package in both locations.

However, I don’t have the import-in-the-middle package explicitly installed in my project. This warning appears inconsistently — sometimes it shows up, and other times it doesn't.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 13, 2025
Copy link
Member

mydea commented May 14, 2025

can you try to make sure that you only have one version of this installed - e.g. by removing this from your lockfile, and re-installing?

@coderrshyam
Copy link

can you try to make sure that you only have one version of this installed - e.g. by removing this from your lockfile, and re-installing?

Yes! The warning still occurs even after deleting node_modules, .next, and pnpm-lock.yaml, followed by a fresh install.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 14, 2025
@stijnbe
Copy link

stijnbe commented May 14, 2025

@coderrshyam
Copy link

@coderrshyam it looks like you are running into the issue described here: https://docs.sentry.io/platforms/javascript/guides/node/troubleshooting/#pnpm-resolving-import-in-the-middle-external-package-errors

@stijnbe It only occurs when i use Turbopack.

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 May 14, 2025
@chargome
Copy link
Member

@coderrshyam other users in this thread suggested updating .npmrc with

public-hoist-pattern[]=*import-in-the-middle*
public-hoist-pattern[]=*require-in-the-middle*

Alternatively please refer to https://docs.sentry.io/platforms/javascript/guides/node/troubleshooting/#pnpm-resolving-import-in-the-middle-external-package-errors

@MisterJimson
Copy link

@chargome I think the reason folks are bringing it up here is that it's not clear why this behaviour changes only when turboback is enabled. That is what I see as well. If it was purely a pnpm issue, I would expect it to be consistent between the modes.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 15, 2025
@chargome chargome assigned chargome and unassigned lforst May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests