-
-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of null (reading 'useContext') #693
Comments
same issue |
change your package.json like this :
|
I have the same issue for me , this are my dependencies
|
This works (Not recommended)This issue because mismatch of Recommendedrefer this comment ├─┬ @material-tailwind/[email protected] |
fix : creativetimofficial#693, update react and react-dom version to 18.3.1
I tried changing react-dom,react,react-router-dom version but still no solution i still get "Cannot read properties of null (reading 'useContext') |
Version 2.0.5 worked for me Link: https://www.material-tailwind.com/docs/react/release-notes#v2.0.5 |
You should change |
This is my package-lock.json
I Tried this. I update package-lock.json
"name": "userend", |
Then the React version should simply be updated in this project, no? |
@naimulemon "node_modules/@material-tailwind/react": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@material-tailwind/react/-/react-2.1.9.tgz",
"integrity": "sha512-3uPlJE9yK4JF9DEQO4I1QbjR8o05+4fysLqoZ0v38TDOLE2tvDRhTBVhn6Mp9vSsq5CoJOKgemG7kbkOFAji4A==",
"dependencies": {
"@floating-ui/react": "0.19.0",
"classnames": "2.3.2",
"deepmerge": "4.2.2",
"framer-motion": "6.5.1",
"material-ripple-effects": "2.0.1",
"prop-types": "15.8.1",
"react": "18.2.0", // change this version to 18.3.1
"react-dom": "18.2.0", // change this version to 18.3.1
"tailwind-merge": "1.8.1"
}, |
Suggestions to change package-lock.json are not viable for build processes - I ended up downgrading like another user suggested to version 2.0.5 and it worked. To me this is a serious bug. It happened specifically while importing PopOver component when I removed that it worked fine using latest version of material-tailwind react but I'm not sure why some components user different versions of React |
If you're using NPM, you can include in your package.json: "overrides": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
} To force the version of react/react-dom universally, no matter what your dependencies want. |
downgrading the version of @material-tailwind/react to 2.0.5 worked for me. No other solution worked. |
This issue because mismatch of react-dom versions. @material-tailwind/react dependencies such as @floating-ui/react uses react and dom version 18.3.1 . but @material-tailwind/react use react and dom version 18.2.0 . you can update this versions to 18.3.1 in package-lock.json . and reinstall all packages with npm install . ├─┬ @material-tailwind/[email protected] |
I just override the react version it works.
|
same issue and this is my package.json |
bug still happening upto today whose gonna save the world |
Still getting it to this day. Running it with the latest and greatest Remix version. |
I'm not sure why so many people are suggesting to update package-lock.json file, this file is not meant to be edited, it will lead to inconsistencies and conflicts and particularly not useful for build processes that do a fresh install. |
This worked for me. Thanks! |
|
Isso funcionou para mim também. |
nice job, is worked. |
Environment Information:
Whenever I try to use any material tailwind component, I got this error.
There is not any error in my old projects where i have used the material tailwind package.
The text was updated successfully, but these errors were encountered: