Using swiperjs in nextjs, after upgrading the react version to 18.x, an error is reported:
Cannot read properties of undefined (reading ‘wrapperClass’)
Current version information:
"next": "^12.1.7-canary.30",
"react": "^18.2.0-next-e531a4a62-20220505",
"react-dom": "^18.2.0-next-e531a4a62-20220505",
"swiper": "^7.4.1"
Solution: Via the settings next.config.js
inreactStrictMode : false
or:
Upgrade swiper to the latest version
"next": "^12.1.7-canary.30",
"react": "^18.2.0-next-e531a4a62-20220505",
"react-dom": "^18.2.0-next-e531a4a62-20220505",
"swiper": "^8.2.2"
See More: Swiper crashing with React 18 + Strict Mode
Read More:
- [Solved] swiper Error: The requested module ‘react’ is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export
- NPM install -g create-react-app [How to Solve]
- Attempted import error: ‘mobx-react‘ does not contain a default export (imported as ‘observer‘).
- Taro Use React Hooks Error: TypeError: Object(…) is not a function
- [Solved] error [email protected]: The engine “node” is incompatible with this module.
- Zeal Open html,css, javascript Error: Content rendering error
- Some problems encountered in the initial construction of Ant Design Pro project, such as cross Env, webpack and so on
- [Solved] react Error: Can‘t perform a React state update on an unmounted component
- React Hook “useState“ is called in function “xxx“ which is neither a React function component or
- [Solved] Executing npm install error: npm ERR! code EINTEGRITY
- How to Solve Import antd Error: Module build failed
- Analysis of npm error ENOTFOUND npm ERR! network request to https://npm.***.com/*** failed and the role of the .npmrc file
- How to Solve npm Error: unable to get local issuer certificate
- How to Solve Valgrind 3.14 error on ARM 64
- Git push Failed to connect to localhost port 1080 [How to Solve]
- React-native Error: Make sure you have the Android development environment set up [Solved]
- [ubuntu14.04]Tensorflow: Could not find any downloads that satisfy the requirement
- Error: an error occurred while performing the step: “building kernel modules”. See/var/log/NV
- [Solved] Vite Bulk Import import.meta.glob Error: ERR_ABORTED 403 (Forbidden)
- [Solved] Android Studio Compile Error: Could not determine java version from ‘11.0.8‘.