Skip to content

Conversation

@AlessioGr
Copy link
Member

@AlessioGr AlessioGr commented Nov 17, 2025

Hides external packages warning

If storage-s3 is installed, the following turbopack warning will be thrown:

Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.\nTry to install it into the project directory by running

We cannot fix this until Next.js implements vercel/next.js#76991, so this PR hides the warning for now. On Next.js 16, this would be an error, but we can't hide or fix that.

Alternatively, we can fix this in Payload 4.0, by requiring users to install the aws sdk as a peerDependency.

Throws warning on Next.js 15.2.x

The minimum Next.js version we currently support is 15.2.3. Unfortunately, the Next.js config turbopack property was added in 15.3.0. On 15.2.3, the following warning is thrown if you use Payload: Unrecognized key(s) in object: 'turbopack'

Unfortunately we cannot remove this property, as Next.js 16 will throw a warning if we do. Instead, this PR throws a new, consecutive warning that prompts the user to bump their Next.js version or explains that this warning can be ignored:

Screenshot 2025-11-17 at 09 52 21

@AlessioGr AlessioGr enabled auto-merge (squash) November 17, 2025 17:52
@github-actions
Copy link
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

Good, but could be improved.

if (hasTurbopackConfigWarning) {
consoleWarn(...args)
consoleWarn(
'Payload: You can safely ignore the "Invalid next.config" warning above. This only occurs on Next.js 15.2.x or lower. We recommend upgrading to Next.js 15.4.7 to resolve this warning.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have a GitHub discussion or issue we can link to so users don't have to go searching for updates?

Copy link
Member Author

@AlessioGr AlessioGr Nov 17, 2025

Choose a reason for hiding this comment

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

Only this PR - there won't be any updates though and I have no plans to fix this warning on Next.js 15.2.3 as of now

For the other, turbopack externals error, there is vercel/next.js#76991 and #14456

@AlessioGr AlessioGr merged commit 03f19bc into main Nov 17, 2025
95 checks passed
@AlessioGr AlessioGr deleted the fix/withpayload-hide-warnings branch November 17, 2025 18:20
@github-actions
Copy link
Contributor

🚀 This is included in version v3.65.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants