The `deploymentId` in your `next.config.js` contains characters that are not allowed. Only alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (\_) are permitted.
## Possible Ways to Fix It
### Option 1: Remove Invalid Characters
Remove or replace any characters that are not alphanumeric, hyphens, or underscores:
```js
// ✅ Correct
module.exports = {
deploymentId: 'my-deployment-123', // Only alphanumeric, hyphens, underscores
"979":"invariant: expected %s bytes of postponed state but only received %s bytes",
"980":"Failed to load client middleware manifest",
"981":"resolvedPathname must be set in request metadata",
"982":"`serializeResumeDataCache` should not be called in edge runtime.",
"983":"deploymentId function must return a string. https://nextjs.org/docs/messages/deploymentid-not-a-string",
"984":"The deploymentId \"%s\" cannot start with the \"dpl_\" prefix. Please choose a different deploymentId in your next.config.js. https://vercel.com/docs/skew-protection#custom-skew-protection-deployment-id",
"985":"The deploymentId \"%s\" exceeds the maximum length of 32 characters. Please choose a shorter deploymentId. https://nextjs.org/docs/messages/deploymentid-too-long",
"986":"The deploymentId \"%s\" contains invalid characters. Only alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_) are allowed. https://nextjs.org/docs/messages/deploymentid-invalid-characters"
"982":"`serializeResumeDataCache` should not be called in edge runtime."
`The deploymentId "${envDeploymentId}" exceeds the maximum length of 32 characters. Please choose a shorter deploymentId. https://nextjs.org/docs/messages/deploymentid-too-long`
)
}
constvalidCharacterPattern=/^[a-zA-Z0-9_-]+$/
if(!validCharacterPattern.test(envDeploymentId)){
thrownewError(
`The deploymentId "${envDeploymentId}" contains invalid characters. Only alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_) are allowed. https://nextjs.org/docs/messages/deploymentid-invalid-characters`
`The deploymentId "${userConfiguredDeploymentId}" exceeds the maximum length of 32 characters. Please choose a shorter deploymentId. https://nextjs.org/docs/messages/deploymentid-too-long`
`The NEXT_DEPLOYMENT_ID environment variable value "${process.env.NEXT_DEPLOYMENT_ID}" does not match the provided deploymentId "${result.deploymentId}" in the config.`