From 7868c48dfd27411d0da4016f6bc4f220b1ac26e5 Mon Sep 17 00:00:00 2001 From: Zhi Date: Fri, 12 Jun 2026 04:25:16 +0800 Subject: [PATCH] fix: suppress TS1192 for CJS-type npm packages on TS 6.0 / Deno v2.8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deno v2.8.3 upgraded TypeScript from 5.9.2 to 6.0.3. TS 6.0 changed \export =\ in ESM context from a warning (TS1203) to a hard error (TS1192): \Module has no default export\. \@prefresh/vite\ and \@tailwindcss/postcss\ both publish \.d.ts\ files using \export =\ (CJS syntax), but their \exports.import\ condition declares ESM support. With Deno's default \moduleResolution: NodeNext\, TS 6.0 sees \exports.import\ and treats the \.d.ts\ as ESM — where \export =\ is now an error. This is reproducible against stock \ sc --moduleResolution NodeNext\ and is not a Deno bug. The runtime import works correctly (Deno handles CJS→ESM interop). The upstream packages' type declarations and package.json metadata are self-contradictory. Temporary fix: \@ts-ignore TS1192\ with a comment explaining the situation. Upstream issues should be filed for both packages to resolve the \export =\ vs \exports.import\ inconsistency. --- packages/plugin-tailwindcss/src/mod.ts | 1 + packages/plugin-vite/src/mod.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/plugin-tailwindcss/src/mod.ts b/packages/plugin-tailwindcss/src/mod.ts index 6db172a80b5..053cd26744a 100644 --- a/packages/plugin-tailwindcss/src/mod.ts +++ b/packages/plugin-tailwindcss/src/mod.ts @@ -1,4 +1,5 @@ import type { Builder } from "fresh/dev"; +// @ts-ignore TS1192 - @tailwindcss/postcss uses `export =` CJS syntax import twPostcss from "@tailwindcss/postcss"; import postcss from "postcss"; import type { TailwindPluginOptions } from "./types.ts"; diff --git a/packages/plugin-vite/src/mod.ts b/packages/plugin-vite/src/mod.ts index c49c244526c..76722e78204 100644 --- a/packages/plugin-vite/src/mod.ts +++ b/packages/plugin-vite/src/mod.ts @@ -6,6 +6,7 @@ import { } from "./utils.ts"; import { deno } from "./plugins/deno.ts"; +// @ts-ignore TS1192 - @prefresh/vite uses `export =` CJS syntax import prefresh from "@prefresh/vite"; import { serverEntryPlugin } from "./plugins/server_entry.ts"; import { clientEntryPlugin } from "./plugins/client_entry.ts";