I am currently trying to integrate Amity with our project however having problems with it. Here are the steps I have taken;
Cloned the UIKit and followed the readme (git@github.com:AmityCo/Amity-Social-Cloud-UIKit-Web-OpenSource.git)
Started following the steps from README.
Received warnings from npm ci step; (There are more but copied couple of them here)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-inspector@5.1.1
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN peer react@"^18.2.0" from the root project
npm WARN 55 more (@fortawesome/react-fontawesome, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.4 || ^17.0.0" from react-inspector@5.1.1
npm WARN node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN react-inspector@"^5.1.0" from @storybook/addon-actions@6.5.16
npm WARN node_modules/@storybook/addon-actions
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN peer react@"^16.8.4 || ^17.0.0" from react-inspector@5.1.1
npm WARN node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN react-inspector@"^5.1.0" from @storybook/addon-actions@6.5.16
npm WARN node_modules/@storybook/addon-actions
I have continued with the other steps.
4. npm link
5. npm link ./`<path-to-your-app>`/node_modules/react ./`<path-to-your-app>`/node_modules/react-dom
6. npm run build
7. cd ./`<path-to-your-app>`
8. npm link @amityco/ui-kit-open-source --save
I have added amityUikit.d.ts to the root folder and added to the tsconfig.json to fix the type error.
Type error: Type â{ children: Element; key: undefined; apiKey: string; apiEndpoint: string; userId: undefined; displayName: undefined; }â is not assignable to type âIntrinsicAttributesâ.
Property âchildrenâ does not exist on type âIntrinsicAttributesâ.
Thanks for the response. My problem is not that I am running but unable to connect. (Other values are incorrect too otherwise. ) Problem is when I run npm run build this is the output I am getting.
> next build
ⲠNext.js 14.0.1
- Environments: .env.local, .env.production
â Creating an optimized production build
â Compiled successfully
Linting and checking validity of types ..Failed to compile.
./src/app/(Site)/chat/page.tsx:17:8
Type error: Type '{ children: Element; apiKey: string; apiRegion: string; userId: string; displayName: string; }' is not assignable to type 'IntrinsicAttributes'.
Property 'children' does not exist on type 'IntrinsicAttributes'.
15 | return (
16 | <div>
> 17 | <AmityUiKitProvider
| ^
18 | apiKey=""
19 | apiRegion="sg"
20 | userId="valeriy-test"
Linting and checking validity of types ...
It is complaining about the AmityUiKitSocial as the children. When I remove the AmityUiKitProvider then I get the error
Type error: Type '{ apiKey: string; apiRegion: string; userId: string; displayName: string; }' is not assignable to type 'IntrinsicAttributes'.
Property 'apiKey' does not exist on type 'IntrinsicAttributes'.
16 | <div>
17 | <AmityUiKitProvider
> 18 | apiKey=""
| ^
19 | apiRegion="sg"
20 | userId="valeriy-test"
21 | displayName="valeriy-test" />
I remove apiKey then it complains about the next property and so on.
By the way AmityUiKitProvider missing some properties from your example like theme, apiEndpoint etc. however adding them does not have an effect. Still getting the same error with AmityUiKitProvider. (Property âchildrenâ does not exist on type âIntrinsicAttributesâ.)
The current code seems correct, could you please help check and confirm, which line/function this error comes from (Property âchildrenâ does not exist on type âIntrinsicAttributesâ.) ?
Error comes pointing the AmityUiKitProvider. It is complainin about the AmityUiKitSocial that is placed as the children.
Below is the full error;
Type error: Type '{ children: Element; key: string; apiKey: string; apiEndpoint: string; apiRegion: string; userId: string; displayName: string; }' is not assignable to type 'IntrinsicAttributes'.
Property 'children' does not exist on type 'IntrinsicAttributes'.
21 | return (
22 | <div>
> 23 | <AmityUiKitProvider
| ^
24 | key='test'
25 | apiKey=""
26 | apiEndpoint="https://api.sg.amity.co"
And if I remove the AmityUiKitSocial then it is complaining about the apiKey.
Below is the full error after I remove the AmityUiKitSocial property from the code.
Hello, sorry for the late reply. I have been away from the computer for the last couple of days.
I have tried using the @amityco/ui-kit however same issue still persists. And I managed to actually reproduce the same issue by creating a new NextJs app.
I believe you can reproduce the issue following the steps below.
Hello! @Baris Weâre looking into the reported issue. After our recent holiday, weâre actively addressing it. Stay tuned for updates. Thanks for your patience!
Weâre sorry for the delay in resolving the issue you reported. Itâs an unusual problem, so weâre taking some time to figure it out. Our team is working hard to identify the cause and will update you as soon as we make progress.
Thank you @SocialPlus_Support. I have replied to the email, however I do not believe the issue here is related to the use of the incorrect api-key. I will keep monitoring my email for further communication.