mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
34 lines
706 B
Plaintext
34 lines
706 B
Plaintext
---
|
|
title: 'Invalid options type in a `next/dynamic` call'
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
You have an invalid options type in a `next/dynamic` call. The options must be an object literal.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
**Before**
|
|
|
|
```jsx filename="example.js"
|
|
import dynamic from 'next/dynamic'
|
|
|
|
const options = { loading: () => <p>...</p>, ssr: false }
|
|
const DynamicComponent = dynamic(() => import('../components/hello'), options)
|
|
```
|
|
|
|
**After**
|
|
|
|
```jsx filename="example.js"
|
|
import dynamic from 'next/dynamic'
|
|
|
|
const DynamicComponent = dynamic(() => import('../components/hello'), {
|
|
loading: () => <p>...</p>,
|
|
ssr: false,
|
|
})
|
|
```
|
|
|
|
## Useful Links
|
|
|
|
- [Dynamic Import](/docs/pages/guides/lazy-loading)
|