Replies: 1 comment
-
Today I was trying to upgrade from a NextUI version 1.x for a project that was using the "pages directory setup" and I had the same problem. I was able to figure it out after some research. It seems as though the upgrading to version 2.x instructions are incomplete if you are using this type of set up. It seems that that line of code containing the CssBaseline.flush() should be removed from the _document file. To fix the issue, I just had to literally go into my _document.js (not using typescript for my project) and comment out the line containing: I was able to figure this out by making a new, blank NextUI project using version 2.x that is using the "pages directory setup" and compared it to my current project. This was able to show me the difference from its _document.js file vs mine and I saw that that line of code is not there. If you would like to create a basic project as I did to compare your config files with a working project's, just create a new NextJs project, then run the following commands: npm i @nextui-org/react framer-motion You can see the steps here https://nextui.org/docs/frameworks/nextjs under the "Pages Directory Setup" section. Below is my current _document.js file: import React from "react"; class MyDocument extends Document { render() {
} export default MyDocument; |
Beta Was this translation helpful? Give feedback.
-
Hi, in the instalation of nextui i got this error:
TypeError: Cannot read properties of undefined (reading 'flush')
my _document.tsx file:
My libraries:
Beta Was this translation helpful? Give feedback.
All reactions