You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
I've created the _document.js as suggested in the template but I get this error in the console:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
The code is this:
import React from 'react'
import Document, {Html, Head, Main, NextScript} from 'next/document'
import client from '../client'
export default class MyDocument extends Document {
static async getInitialProps (ctx) {
const initialProps = await Document.getInitialProps(ctx)
return client.fetch('*[_id == "global-config"] {lang}.lang[0]').then(lang => {
return {...initialProps, lang}
})
}
render () {
return (
}
}
Has anyone had this issue?And if yes , how did you solve it?Thank you in advance!
The text was updated successfully, but these errors were encountered: