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): Detect new locations for request async storage to support Next.js v15.0.0-canary.180 and higher #13920

Merged

Conversation

ykzts
Copy link
Contributor

@ykzts ykzts commented Oct 9, 2024

In Next.js v15.0.0-canary.180, requestAsyncStorage was removed and merged into workUnitAsyncStorage (vercel/next.js#70819). workUnitAsyncStorage is used if available. workUnitAsyncStorage is used when workUnitAsyncStorage is present.


Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

requestAsyncStorage: RequestAsyncStorage;
};

const asyncStorageModule = { ...origModule } as NextAsyncStorageModule;
Copy link
Member

Choose a reason for hiding this comment

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

Did you find a reason that we should clone the object? It may be a bit expensive to do so in various ways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, requestAsyncStorage is not exported is returned when not use clone.

@ykzts ykzts force-pushed the fix/support-nextjs-v15.0.0-canary.180 branch from 6248808 to 1660b9b Compare October 10, 2024 00:42
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.

Awesome work. I see you figured out that you had to add the new files to the potential locations. Thank you very much!

@lforst lforst changed the title fix(nextjs): support next v15.0.0-canary.180 or higher fix(nextjs): Detect new locations for request async storage to support Next.js v15.0.0-canary.180 and higher Oct 10, 2024
@lforst lforst merged commit 6b4401f into getsentry:develop Oct 10, 2024
100 checks passed
@ykzts ykzts deleted the fix/support-nextjs-v15.0.0-canary.180 branch October 10, 2024 07: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.

2 participants