uif icon indicating copy to clipboard operation
uif copied to clipboard

Notification dependencies issue. Failed to compile.

Open t1r opened this issue 7 months ago • 0 comments

Condition:

    "@kaspersky/components": "6.42.1",

Reproductions steps:

  1. Create react app yarn create react-app my-app --template typescript

  2. Add Kaspersky components deps, (yarn) "@kaspersky/components": "6.42.1",

  3. 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>
    )
}
  1. 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

t1r avatar Jul 03 '24 06:07 t1r