Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification dependencies issue. Failed to compile. #69

Open
t1r opened this issue Jul 3, 2024 · 0 comments
Open

Notification dependencies issue. Failed to compile. #69

t1r opened this issue Jul 3, 2024 · 0 comments

Comments

@t1r
Copy link

t1r commented Jul 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant