Skip to content

temp fix: suppress TS1192 for CJS-type npm packages on TS 6.0 / Deno v2.8.3#3857

Open
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/ts1192-cjs-export-equals
Open

temp fix: suppress TS1192 for CJS-type npm packages on TS 6.0 / Deno v2.8.3#3857
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/ts1192-cjs-export-equals

Conversation

@SisyphusZheng

@SisyphusZheng SisyphusZheng commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Deno v2.8.3 upgraded TypeScript from 5.9.2 to 6.0.3, which changed export = in ESM context from a warning (TS1203) to a hard error (TS1192). This causes deno check to fail on any imported npm package whose .d.ts uses export = CJS syntax but whose package.json declares ESM support via exports.import.

Two dependencies in this repo are affected:

Import File Package
import prefresh from "@prefresh/vite" packages/plugin-vite/src/mod.ts:9 @prefresh/vite@2.4.11
import twPostcss from "@tailwindcss/postcss" packages/plugin-tailwindcss/src/mod.ts:2 @tailwindcss/postcss@4.1.16
TS1192: Module '...index.d.ts' has no default export.

Root Cause Analysis

Fresh deno.json:          moduleResolution → NodeNext (Deno default)
npm package.json:          exports.import → declares ESM support
npm .d.ts:                 export = → CJS syntax

TS 6.0 + NodeNext → sees exports.import → treats .d.ts as ESM
                  → export = in ESM → TS1192 ERROR

This is reproducible against stock tsc --moduleResolution NodeNext — not a Deno-specific bug. The upstream packages have a self-contradictory setup: exports.import says ESM, but type declarations use CJS syntax (export =).

The runtime import works correctly — Deno handles CJS→ESM interop at runtime. Only the type checker disagrees.

Fix

Add @ts-ignore TS1192 with an explanatory comment on the two affected imports.

Follow-up

  • File issue on @prefresh/vite (maintained by @marvinhagemeister, also a Fresh maintainer) to resolve export = vs exports.import inconsistency
  • File issue on @tailwindcss/postcss for the same type declaration issue

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.
@Hajime-san

Copy link
Copy Markdown
Contributor

@SisyphusZheng

Copy link
Copy Markdown
Contributor Author

It's a regression. Not a Fresh side problem.

I understand, but this has impacted the current CI v2. This is only a temporary hotfix, and I’ve also raised an issue on the Deno side.

@SisyphusZheng SisyphusZheng changed the title fix: suppress TS1192 for CJS-type npm packages on TS 6.0 / Deno v2.8.3 temp fix: suppress TS1192 for CJS-type npm packages on TS 6.0 / Deno v2.8.3 Jun 12, 2026
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

Successfully merging this pull request may close these issues.

2 participants