uif
uif copied to clipboard
Notification dependencies issue. Failed to compile.
Condition:
"@kaspersky/components": "6.42.1",
Reproductions steps:
-
Create react app
yarn create react-app my-app --template typescript
-
Add Kaspersky components deps, (yarn)
"@kaspersky/components": "6.42.1",
-
Create component with Notification component:
import { Button, Notification, Space, openNotification, Text } from '@kaspersky/components';
import type { NotificationProps } from '@kaspersky/components/src/notification/types';
export const NotifComponent2 = () => {
const props: NotificationProps = {
id: "myNotificationId",
mode: 'info',
duration: 1,
description: "Just notifications text",
};
const handleOpenNotifcation = () => {
openNotification(props);
};
return(
<Space>
<Button onClick={handleOpenNotifcation}>
<Text type="BTM3">Text text</Text>
</Button>
<Notification
{...props}
/>
</Space>
)
}
- Run app (yarn start)
Fact: Got a lot of errors like:
Failed to compile.
ERROR in ./node_modules/@kaspersky/components/design-system/tokens/icons.js 7:31-61
Module not found: Error: Can't resolve '@kaspersky/icons/48' in 'C:\Users\user\WebProjects\notification-uif\node_modules\@kaspersky\components\design-system\tokens'
It can resolve by add to projects deps
"@kaspersky/icons": "2.3.0"
Expected: Works without errors