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.
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
npmorpnpmas its package manager, I get this error when starting my application:__spreadArraywas added in tslib 2.1.0, so the error means the code is importing an older version oftslib.I don't see this error if I switch to Yarn 1 (Classic), presumably it resolves the
tslibversion 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 iorpnpm i, and start the app withnpm devorpnpm dev. (Enablepnpmwithcorepack enableif needed.)Specifications
Possible Solution
As shown by the error,
tslibis a runtime dependency because code indistimports from it. However,tslibis included in the project'sdevDependencies. Moving it todependenciesshould 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.