<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ошибка ts 1484]]></title><description><![CDATA[<p dir="auto">Наверное многие кто только вкатываются в TypeScript встречаются с такой типовой ошибкой как ts 1484:<br />
<code>User is a type and must be imported using a type-only import when verbatimModuleSyntax is enabled. (ts 1484)</code></p>
<p dir="auto">Давайте разберем что тут происходит, если говорить дословно то TypeScript говорит нам что мы импортируем типы, а не какой-то другой модель.</p>
<p dir="auto">Всего скорее у вас есть файл <code>entities/types.ts</code> где есть <code>interface</code> или <code>type</code>:</p>
<pre><code class="language-ts">interface User {
  name: string;
  age: number;
}

export { User }
</code></pre>
<p dir="auto">А импортируете вы его так:</p>
<pre><code class="language-ts">import { User } from "../entities/types.ts"
</code></pre>
<p dir="auto">И вот как раз тут и кроется вся суть проблемы, TS ожидает что мы импортируем именно типы, а для этого после ключевого слова <code>import</code> необходимо добавить <code>type</code>:</p>
<pre><code class="language-ts">import type { User } from "../entities/types.ts"
</code></pre>
<p dir="auto">После того как мы подставим ключевое слово <code>type</code> ошибка должна пропасть.</p>
<p dir="auto">Также помимо импорта, есть более строгий тип экспорта:</p>
<pre><code class="language-ts">export type { User }
</code></pre>
<p dir="auto">он запрещает использовать импортированное как значение. Полезно при включенном <code>isolatedModules</code> (Vite, esbuild).</p>
]]></description><link>https://forum.exlends.com/topic/2206/oshibka-ts-1484</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 12:55:10 GMT</lastBuildDate><atom:link href="https://forum.exlends.com/topic/2206.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Apr 2026 12:27:08 GMT</pubDate><ttl>60</ttl></channel></rss>