mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
34 lines
664 B
Plaintext
34 lines
664 B
Plaintext
---
|
|
title: '`deploymentId` must be a string'
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
The `deploymentId` option in your `next.config.js` must be a string value.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
Ensure your `deploymentId` is a string:
|
|
|
|
```js
|
|
// ✅ Correct
|
|
module.exports = {
|
|
deploymentId: 'my-deployment-123',
|
|
}
|
|
|
|
// ✅ Using environment variables
|
|
module.exports = {
|
|
deploymentId: process.env.GIT_HASH || 'default-id',
|
|
}
|
|
|
|
// ❌ Incorrect
|
|
module.exports = {
|
|
deploymentId: 12345, // Must be a string, not a number
|
|
}
|
|
```
|
|
|
|
The `deploymentId` can be:
|
|
|
|
- A string: `deploymentId: 'my-deployment-123'`
|
|
- `undefined` (will use `NEXT_DEPLOYMENT_ID` environment variable if set)
|