Skip to content

@workflowbuilder/ui: types fail under moduleResolution node16/nodenext due to extensionless relative imports in .d.ts files #275

Open

Description

@trackoor

@workflowbuilder/ui declares "type": "module", so TypeScript treats its .d.ts files as ES modules, but the published declarations use extensionless relative specifiers (for example export * from './components/accordion' in dist/index.d.ts and export * from './date-picker' in dist/components/date-picker/index.d.ts), causing all root and subpath exports to fail to resolve under moduleResolution: "node16" or "nodenext".

Reproduction (tsconfig.json and repro.mts in an empty directory):

{
  "compilerOptions": {
    "module": "nodenext",
    "moduleResolution": "nodenext",
    "strict": true,
    "noEmit": true,
    "skipLibCheck": true
  },
  "files": ["repro.mts"]
}
import { Accordion, Avatar } from "@workflowbuilder/ui";
import { DatePicker } from "@workflowbuilder/ui/date-picker";
npm i @workflowbuilder/[email protected] react@19 @types/react@19 [email protected]
npx tsc -p .

Actual output:

repro.mts(1,10): error TS2305: Module '"@workflowbuilder/ui"' has no exported member 'Accordion'.
repro.mts(1,21): error TS2305: Module '"@workflowbuilder/ui"' has no exported member 'Avatar'.
repro.mts(2,10): error TS2305: Module '"@workflowbuilder/ui/date-picker"' has no exported member 'DatePicker'.

With "skipLibCheck": false, tsc also reports 30 TS2834 errors inside node_modules/@workflowbuilder/ui/dist/**/*.d.ts:

node_modules/@workflowbuilder/ui/dist/index.d.ts(1,15): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

Expected output: no errors (as with npx tsc -p . --module esnext --moduleResolution bundler).

Likely cause: packages/ui/vite.config.mts emits declarations with vite-plugin-dts without bundling types or adding .js extensions to relative and rewritten @ui/* specifiers (unlike packages/sdk/vite.config.mts, which sets rollupTypes: true, and publint in packages/ui only checks package.json entry paths rather than imports inside .d.ts files).

Versions tested: @workflowbuilder/[email protected] (latest on npm) and main at 05221c2 (pnpm --filter @workflowbuilder/ui build), with TypeScript 5.9.3 and 7.0.2 on Node v26.13.0.

Credit: https://ucsbplse.github.io/

Activity

  1. piotrblaszczyk commented on Nov 23, 2026

    @piotrblaszczyk
    Contributor

    Thanks for the precise report. Reproduced on @workflowbuilder/[email protected]: under node16 and nodenext every root and subpath export fails to resolve, for the reason you describe. bundler resolution works, which is why our own apps never hit it.

    We will look into it and let you know here once it is resolved.

    For now, the workaround is moduleResolution: "bundler".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions