Skip to content

Commit 7868c48

Browse files
committed
fix: suppress TS1192 for CJS-type npm packages on TS 6.0 / Deno v2.8.3
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.
1 parent 86d6cde commit 7868c48

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

packages/plugin-tailwindcss/src/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Builder } from "fresh/dev";
2+
// @ts-ignore TS1192 - @tailwindcss/postcss uses `export =` CJS syntax
23
import twPostcss from "@tailwindcss/postcss";
34
import postcss from "postcss";
45
import type { TailwindPluginOptions } from "./types.ts";

packages/plugin-vite/src/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from "./utils.ts";
77
import { deno } from "./plugins/deno.ts";
88

9+
// @ts-ignore TS1192 - @prefresh/vite uses `export =` CJS syntax
910
import prefresh from "@prefresh/vite";
1011
import { serverEntryPlugin } from "./plugins/server_entry.ts";
1112
import { clientEntryPlugin } from "./plugins/client_entry.ts";

0 commit comments

Comments
 (0)