Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 736 Bytes

invalid-dynamic-options-type.mdx

File metadata and controls

33 lines (22 loc) · 736 Bytes
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

import dynamic from 'next/dynamic'

const options = { loading: () => <p>...</p>, ssr: false }
const DynamicComponent = dynamic(() => import('../components/hello'), options)

After

import dynamic from 'next/dynamic'

const DynamicComponent = dynamic(() => import('../components/hello'), {
  loading: () => <p>...</p>,
  ssr: false,
})

Useful Links