Skip to content

fix: use namespace imports for packages losing default exports on canary#3840

Closed
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/canary-default-imports
Closed

fix: use namespace imports for packages losing default exports on canary#3840
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/canary-default-imports

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Contributor

Problem

Deno canary CI fails with TS1192: Module has no default export for two npm packages:

File Import Error
packages/plugin-tailwindcss/src/mod.ts import twPostcss from "@tailwindcss/postcss" TS1192
packages/plugin-vite/src/mod.ts import prefresh from "@prefresh/vite" TS1192

The default exports exist at runtime but their .d.ts type declarations lose
the default export signature on canary builds.

Changes

packages/plugin-tailwindcss/src/mod.ts

  • import twPostcss from "@tailwindcss/postcss" → import * as twPostcss from "@tailwindcss/postcss"
  • wPostcss({...}) → wPostcss.default({...})

packages/plugin-vite/src/mod.ts

  • import prefresh from "@prefresh/vite" → import * as prefresh from "@prefresh/vite"
  • prefresh({...}) → prefresh.default({...})

Verification

deno task check:types passes on stable Deno v2.7.14.

@SisyphusZheng SisyphusZheng force-pushed the fix/canary-default-imports branch from 7e4a82f to cee3f44 Compare June 11, 2026 13:46
@SisyphusZheng

Copy link
Copy Markdown
Contributor Author

Closing: this has been superseded by #3857 which uses @ts-ignore TS1192\ with a detailed comment. The @ts-ignore\ approach is cleaner (no .default()\ boilerplate at call sites) and self-documents the root cause (upstream packages have self-contradictory CJS types + ESM exports). Both approaches achieve the same result at runtime — #3857 is the preferred fix.

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.

1 participant