-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 'useState') #6187
Comments
Would be good to see project with next and swiper only. You have too much of deps, so it can be affected by something else |
@nolimits4web yep that is true. But even in case of a conflict, I think that swiper should either give us a more meaningful error message, or somehow manage the conflict internally. In fact, I intentionally created that repo with all of our dependencies, to provide a real-world scenario. I would create a standalone repo too. |
I also upgraded to Next 13 and I also see this error. @nolimits4web I don't think there should be a need to create a isolated repo. Swiper should not be affected by other libraries. Even if it is now, it should be fixed. I realized that if we comment out the components of our pages, save, and then uncomment them the problem goes away for that page. But if we refresh the page it appears again. It seems something related to Next 13 hydration is the culprit here. |
@nolimits4web I forked his repo and cleaned it up and found the problem source. Here's the fork. Clone it, and toggle the value of You should see the error when it's set to |
That is definitely something on Next side, it complains on this line:
I think you should open this issue for Next |
How can we find more comprehensive differences between 6, 7, and 8 |
Check that this is really a bug
Reproduction link
https://github.com/hosseinitabar/swiper-bug
Bug description
We upgraded to next.js 13.
And now we receive this error:
I created a simple repository, with all of our next.js config and all of our packages.
If you clone it and run it using
npm install && npm run dev
you'll see this error.Expected Behavior
Swiper either should work with next.js 13, or at least it should give us clearer message.
Actual Behavior
All it says is:
Swiper version
8.4.4
Platform/Target and Browser Versions
Debian Chrome 107.0.5304.87 (Official Build) (64-bit)
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: