Repository: vercel/next.js
Pull request: [nextjs] feat: removing length requirement

Not a hard requirement so removing in [response to request](https://github.com/vercel/next.js/pull/88958#discussion_r2735487290)

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to understand the PR)
- When linking to a Slack thread, you might want to share details of the conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Changed files:
filename: errors/deploymentid-too-long.mdx
patch: @@ -1,37 +0,0 @@
----
-title: '`deploymentId` exceeds maximum length'
----
-
-## Why This Error Occurred
-
-The `deploymentId` in your `next.config.js` exceeds the maximum length of 32 characters.
-
-## Possible Ways to Fix It
-
-### Option 1: Shorten Your Deployment ID
-
-Reduce the length of your `deploymentId` to 32 characters or less:
-
-```js
-// next.config.js
-module.exports = {
-  deploymentId: 'my-short-id', // ✅ 12 characters
-}
-```
-
-### Option 2: Truncate Environment Variables
-
-If using environment variables, ensure the value is truncated to 32 characters:
-
-```js
-// next.config.js
-module.exports = {
-  deploymentId: process.env.DEPLOYMENT_ID?.substring(0, 32),
-}
-```
-
-## Additional Information
-
-- The deployment ID is used for skew protection and asset versioning
-- Keep it concise but meaningful for your use case
-- Consider using hashes or shortened identifiers if you need unique values

filename: packages/next/errors.json
patch: @@ -985,7 +985,6 @@
   "984": "LRUCache: calculateSize returned %s, but size must be > 0. Items with size 0 would never be evicted, causing unbounded cache growth.",
   "985": "No response is returned from route handler '%s'. Expected a Response object but received '%s' (method: %s, url: %s). Ensure you return a \\`Response\\` or a \\`NextResponse\\` in all branches of your handler.",
   "986": "Server Action arguments list is too long (%s). Maximum allowed is %s.",
-  "987": "Invalid \\`deploymentId\\` configuration: exceeds maximum length of 32 characters. See https://nextjs.org/docs/messages/deploymentid-too-long",
-  "988": "Invalid \\`deploymentId\\` configuration: must be a string. See https://nextjs.org/docs/messages/deploymentid-not-a-string",
-  "989": "Invalid \\`deploymentId\\` configuration: contains invalid characters. Only alphanumeric characters, hyphens, and underscores are allowed. See https://nextjs.org/docs/messages/deploymentid-invalid-characters"
+  "987": "Invalid \\`deploymentId\\` configuration: must be a string. See https://nextjs.org/docs/messages/deploymentid-not-a-string",
+  "988": "Invalid \\`deploymentId\\` configuration: contains invalid characters. Only alphanumeric characters, hyphens, and underscores are allowed. See https://nextjs.org/docs/messages/deploymentid-invalid-characters"
 }

filename: packages/next/src/build/index.ts
patch: @@ -978,11 +978,6 @@ export default async function build(
             `Invalid \`deploymentId\` configuration: must be a string. See https://nextjs.org/docs/messages/deploymentid-not-a-string`
           )
         }
-        if (config.deploymentId.length > 32) {
-          throw new Error(
-            `Invalid \`deploymentId\` configuration: exceeds maximum length of 32 characters. See https://nextjs.org/docs/messages/deploymentid-too-long`
-          )
-        }
         if (!/^[a-zA-Z0-9_-]*$/.test(config.deploymentId)) {
           throw new Error(
             `Invalid \`deploymentId\` configuration: contains invalid characters. Only alphanumeric characters, hyphens, and underscores are allowed. See https://nextjs.org/docs/messages/deploymentid-invalid-characters`