2023-07-05 15:11:16 +02:00
|
|
|
---
|
|
|
|
title: It looks like the next instance is being instantiated incorrectly.
|
|
|
|
---
|
2020-06-03 05:19:29 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Why This Error Occurred
|
2020-06-03 05:19:29 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
You have passed a null or undefined parameter to the `next()` call.
|
2020-06-03 05:19:29 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Possible Ways to Fix It
|
2020-06-03 05:19:29 +02:00
|
|
|
|
|
|
|
Make sure you are passing the variables properly:
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
```js filename="server.js"
|
2020-06-03 05:19:29 +02:00
|
|
|
const app = next()
|
|
|
|
```
|
|
|
|
|
|
|
|
And make sure you're passing dev as shown in the examples below:
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
```js filename="server.js"
|
2020-06-03 05:19:29 +02:00
|
|
|
const app = next({ dev: boolean })
|
|
|
|
```
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Useful Links
|
2020-06-03 05:19:29 +02:00
|
|
|
|
|
|
|
- [custom-server-express](https://github.com/vercel/next.js/blob/6ca00bfe312c8d3fc5c20d25a9cd8d2741a29332/examples/custom-server-express/server.js#L6)
|
|
|
|
- [custom-server](https://github.com/vercel/next.js/blob/6ca00bfe312c8d3fc5c20d25a9cd8d2741a29332/examples/custom-server/server.js#L6)
|
|
|
|
- [custom-server-typescript](https://github.com/vercel/next.js/blob/6ca00bfe312c8d3fc5c20d25a9cd8d2741a29332/examples/custom-server-typescript/server/index.ts#L7)
|