I’m following this document for setup UIkit in my document “https://docs.amity.co/uikit/web/web-javascript-migration-guide” but getting this error
Module not found: Error: Can’t resolve ‘@amityco/ui-kit-open-source’ in ‘D:\Agile_Office_Work\Amity-Social-Cloud-Web-Sample-Apps\chat-simple-amity-m2\src’
Can anyone help me for this error?
Hello, from the document, may we confirm, which method did you follow, 1 or 2 ? And what’s your current sdk version?
I try both method but getting same error
TypeError: Cannot read properties of null (reading ‘useState’)
useState
Amity-Social-Cloud-UIKit-Web-OpenSource/node_modules/react/cjs/react.development.js:1433
Hello @praveen.kumar it seems that the issue might be related to ‘useState’ within React, not the UIKit issue. We recommend conducting some research into the ‘useState’ implementation on your end to pinpoint the cause of the problem.
@SocialPlus_Support But I’m not using useState. I created new simple project using “$ npx create-react-app my-react-app”
and run project simple page worked but after the link, I got this error.
Please link the UIKit open source with these following steps to prevent encounter issues
Here are the steps to install ui-kit together with another project.
- git clone git@github.com:AmityCo/Amity-Social-Cloud-UIKit-Web-OpenSource.git
- cd ./Amity-Social-Cloud-UIKit-Web-OpenSource
- npm ci
- npm link
- npm link ./
<path-to-your-app>
/node_modules/react ./<path-to-your-app>
/node_modules/react-dom
- npm run build
- cd ./
<path-to-your-app>
- npm link @amityco/ui-kit-open-source --save
** We need to link react module to react module in destination project so that react is the same instance otherwise we will encounter issues with react hook.