Nextjs version update issue #16512
Unanswered
Er-Ramanand-Dubey
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
sir, I am trying to update the Nextjs version on my project. but I am facing this issue. can anyone help me out, please?
issue is here
C:\Users\MY HP\Desktop\project updating\oldproject>yarn run dev
yarn run v1.22.4
$ next
The static directory has been deprecated in favor of the public directory. https://err.sh/vercel/next.js/static-dir-deprecated
ready - started server on http://localhost:3000
error - ./pages/_document.js
TypeError: C:\Users\MY HP\Desktop\project updating\oldproject\pages_document.js: this.setDynamic is not a function
here is my __document.js file code
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import { cxs } from 'axs';
import { globalStyleObject, globalStyleString } from '../styles';
class CustomDocument extends Document {
static getInitialProps({ renderPage }) {
const page = renderPage();
const style = cxs.getCss();
cxs.reset();
}
render() {
return (
<style dangerouslySetInnerHTML={{ __html: globalStyleString }} />
<style dangerouslySetInnerHTML={{ __html: this.props.style }} />
);
}
}
export default CustomDocument;
Beta Was this translation helpful? Give feedback.
All reactions