Skip to content

DataVis NITRO not consumable from npm — dist/datavis.js externalizes engine to unresolvable datavis/src/* #263

Description

@Taleef7

Summary

Consuming DataVis NITRO via the public @mieweb/ui@0.6.1 npm package fails: the shipped dist/datavis.js imports the grid engine as an external bare package datavis using raw /src/*.ts paths, but that engine (@mieweb/datavis) is never published to npm. The repos being public on GitHub does not make the engine resolvable for an npm consumer.

Environment

  • Consumer: Next.js 16 (App Router) + React 19 + Tailwind 4, pnpm 10
  • @mieweb/ui@0.6.1 (installed from npm)
  • datavis-ace@4.0.0-PRE.2 available on npm ✅ (this peer is not the problem)

What the published artifact actually contains

@mieweb/ui@0.6.1 -> exports["./datavis"] -> dist/datavis.js, whose imports are:

import { Source, ComputedView } from 'datavis-ace';
import { DataGrid } from 'datavis/src/components/DataGrid';
import { determineColumns } from 'datavis/src/adapters/colconfig-adapter';
import { getBuiltinGroupFunctions } from 'datavis/src/adapters/group-adapter';
import { buildAggregateFunctions } from 'datavis/src/adapters/wcdatavis-interop';
import { useView } from 'datavis/src/adapters/use-data';
import { TableRenderer } from 'datavis/src/components/table/TableRenderer';

The build externalized datavis/* rather than bundling it, so the consumer is left to resolve datavis/src/* themselves.

This contradicts the project's own documented build contract

CONTRIBUTING.md is explicit about what is external vs. bundled, and the datavis engine is not supposed to be a consumer-facing external:

  • Build & bundle -> External lists only react, react-dom, ag-grid-*, datavis-ace, @esheet/* as never-bundled peers. The datavis submodule engine is not in that list — yet dist/datavis.js emits bare datavis/src/* imports, i.e. it is being externalized without being a declared/installable peer.
  • Optional peer dependencies lists datavis-ace (not datavis) as what a consumer installs.
  • Submodules table: packages/datavis is "Linked into node_modules/datavis; postinstall repairs a stale link." That alias is monorepo-internal and the package is unpublished, so a consumer install never has it.
  • The consumer adoption guide (lessons/adopting-mieweb-ui.md) gives no instructions for obtaining a datavis engine, because there is no consumer-facing way to.

Why it can't resolve for a consumer

  1. Not on npm. @mieweb/datavis -> 404. The only datavis on npm (datavis@1.0.0, maintainer xudafeng) is an unrelated name collision.
  2. Bare-name mismatch. dist/datavis.js imports datavis but the package is named @mieweb/datavis; this only resolves inside this monorepo via the node_modules/datavis submodule link described in CONTRIBUTING.
  3. Source-only, not a library. @mieweb/datavis is "private": true, version 0.1.0, a Vite app (scripts vite/vite build/storybook, has index.html + src/, no dist/) with no main/module/types/exports/files. The imports target uncompiled /src/*.ts, which Next.js will not transpile from node_modules by default.
  4. Conflicting dependency. @mieweb/datavis depends on an older @mieweb/ui@0.3.0-dev.85 (plus @dnd-kit/*, i18next, react-i18next), i.e. a second copy of the library being consumed at 0.6.1.

Reproduction

  1. pnpm add @mieweb/ui datavis-ace@4.0.0-PRE.2 in a Next.js 16 app.
  2. import { ... } from '@mieweb/ui/datavis'.
  3. Build fails to resolve datavis/src/components/DataGrid (and the other datavis/src/* specifiers).

Suggested fixes (either resolves it)

  1. Preferred: in the @mieweb/ui tsup build, bundle datavis/* into dist/datavis.js instead of externalizing it (it is not in the documented External list, so this looks unintended). Then @mieweb/ui/datavis is self-contained and needs only the public datavis-ace peer.
  2. Alternative: publish @mieweb/datavis to npm/GHCR as a real library — compiled dist, a proper exports map, private: false — and change @mieweb/ui/datavis to import from the package entry points rather than datavis/src/*.

Note

The other @mieweb/ui/* entry points (Button, Modal, Table, Sidebar, Badge, Toast, etc.) all consume cleanly from npm; this is specific to the ./datavis export. @mieweb/ui/ag-grid appears unaffected because its ag-grid-* peers are public on npm. Per CONTRIBUTING, NITRO is the preferred grid over AGGrid, which makes this the blocking path for grid adoption.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions