typescript

Cannot find module '...' or its corresponding type declarations React Typescript Ошибка для использования псевдонима пути alias

Cannot find module '...' or its corresponding type declarations

Возникает для строки:

import SortSign from '@app-universal/SortSign';

Задача

Рассмотрим решение для следующей ситуации, компонент без псевдонимов имопртируется так (в какой-то из родительских компонентов):

import SortSign from '../../../universal/SortSign';

а требуется его импортировать так:

import SortSign from '@app-universal/SortSign';

или так:

vscode Cannot use JSX unless the '--jsx' flag is provided Ошибка

Cannot use JSX unless the '--jsx' flag is provided

Помогает следующее решение:
Идем в tsconfig.json и меняем

    "jsx": "react-jsx"

на

    "jsx": "react"

Источник: https://stackoverflow.com/a/64946881

The engine "node" is incompatible with this module. Expected version Ошибка

@typescript-eslint/eslint-plugin... The engine "node" is incompatible with this module. Expected version

В качестве решение подойдет обновление nodejs до последней версии.

React ts и все остальное

Вопросы по хукам

Pages

Subscribe to RSS - typescript