Skip to content

Incompatible tslib version imported by Feast UI #4521

@peruukki

Description

@peruukki

Expected Behavior

Feast UI dependencies should be resolved to compatible versions regardless of the package manager used.

Current Behavior

When using the Feast UI package as a module in a project that has npm or pnpm as its package manager, I get this error when starting my application:

✘ [ERROR] No matching export in "node_modules/tslib/tslib.es6.js" for import "__spreadArray"

    node_modules/@feast-dev/feast-ui/dist/feast-ui.module.js:9:44:
      9 │ import { __assign as __assign$2, __extends, __spreadArray } from 'tslib';
        │                                             ~~~~~~~~~~~~~
        ╵                                             __spreadArrays

  Did you mean to import "__spreadArrays" instead?

    node_modules/tslib/tslib.es6.js:150:16:
      150 │ export function __spreadArrays() {
          ╵                 ~~~~~~~~~~~~~~

__spreadArray was added in tslib 2.1.0, so the error means the code is importing an older version of tslib.

I don't see this error if I switch to Yarn 1 (Classic), presumably it resolves the tslib version to a later one due to different dependency resolution strategies.

Steps to reproduce

I created an example React app with Vite (Create React App is no longer recommended). You can clone it and install the dependencies with npm i or pnpm i, and start the app with npm dev or pnpm dev. (Enable pnpm with corepack enable if needed.)

Specifications

  • Version: 0.40.0 (@feast-dev/feast-ui version)
  • Platform: WSL or macOS
  • Subsystem: -

Possible Solution

As shown by the error, tslib is a runtime dependency because code in dist imports from it. However, tslib is included in the project's devDependencies. Moving it to dependencies should ensure that a compatible version is always installed and referenced by Feast UI. Currently it picks up the version from its dependencies or from the consuming application.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions