Skip to content

fix(ui): Make feast UI load in Vite without process.env and arrow_down imports - #6724

Open
kchawlani19 wants to merge 2 commits into
feast-dev:masterfrom
kchawlani19:fix/ui-vite-arrowdown-5429
Open

fix(ui): Make feast UI load in Vite without process.env and arrow_down imports#6724
kchawlani19 wants to merge 2 commits into
feast-dev:masterfrom
kchawlani19:fix/ui-vite-arrowdown-5429

Conversation

@kchawlani19

@kchawlani19 kchawlani19 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Importing @feast-dev/feast-ui in a Vite app fails at runtime, blocking the documented module-integration path.

Observed failures included:

  • ReferenceError: process is not defined
  • Failed to fetch dynamically imported module: .../assets/arrow_down?import

Root cause

Two Vite-incompatible runtime paths were involved:

  • Direct process.env reads in browser-executed UI code (FeastUI and CurlGeneratorTab).
  • EUI icon import behavior that triggers unresolved arrow_down dynamic module loading in this packaging context.

Fix

  • Added a safe env helper (getProcessEnv) and replaced direct process.env access in:
    • ui/src/FeastUI.tsx
    • ui/src/pages/feature-views/CurlGeneratorTab.tsx
  • Replaced EuiSelect in ProjectSelector with a native <select> to avoid the dynamic icon import path that causes arrow_down resolution failures.
  • Replaced the user-menu chevron icon usage in Layout with a local inline SVG glyph.
  • Added/updated focused tests:
    • ui/src/utils/environment.test.ts
    • ui/src/components/ProjectSelector.test.tsx

Test plan

  • cd ui && npx jest src/utils/environment.test.ts src/components/ProjectSelector.test.tsx src/FeastUISansProviders.test.tsx --runInBand
  • cd ui && npm run build:lib

Risk / rollback

Risk is low-to-medium and limited to UI behavior:

  • Minor styling/accessibility behavior differences from EuiSelect -> native <select>.
  • User-menu chevron changed to inline SVG.

Rollback is straightforward by reverting this PR commit.

@kchawlani19
kchawlani19 requested a review from a team as a code owner August 10, 2026 11:24
@kchawlani19
kchawlani19 force-pushed the fix/ui-vite-arrowdown-5429 branch from e5ceb05 to 0b5b96b Compare August 10, 2026 12:39
@kchawlani19 kchawlani19 changed the title fix(ui): make Feast UI Vite-compatible by removing browser-only process/env and EUI dynamic icon breakage fix(ui): make feast ui vite-compatible by removing browser-only process/env and eui dynamic icon breakage Aug 10, 2026
@kchawlani19
kchawlani19 force-pushed the fix/ui-vite-arrowdown-5429 branch from 0b5b96b to 66102de Compare August 10, 2026 12:43
@kchawlani19 kchawlani19 changed the title fix(ui): make feast ui vite-compatible by removing browser-only process/env and eui dynamic icon breakage fix(ui): Make feast UI load in Vite without process.env and arrow_down imports Aug 10, 2026
@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.79%. Comparing base (037c4cd) to head (d1ae04e).
⚠️ Report is 3 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6724      +/-   ##
==========================================
+ Coverage   46.76%   46.79%   +0.02%     
==========================================
  Files         415      415              
  Lines       50392    50395       +3     
  Branches     7214     7215       +1     
==========================================
+ Hits        23567    23581      +14     
+ Misses      25171    25162       -9     
+ Partials     1654     1652       -2     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.11% <ø> (+0.02%) ⬆️
see 4 files with indirect coverage changes

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 037c4cd...d1ae04e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ependency and arrow_down icon import path

Signed-off-by: kchawlani19 <kchawlan@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: kchawlani19 <kchawlan@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@kchawlani19
kchawlani19 force-pushed the fix/ui-vite-arrowdown-5429 branch from 66102de to e6daf25 Compare August 10, 2026 13:02
return process;
};

export const getProcessEnv = (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of this PR is Vite compatibility, but the new helper only wraps process.env. In Vite, environment variables are accessed via import.meta.env, not process.env.

Comment thread ui/src/components/ProjectSelector.tsx Outdated
});

const basicSelectId = useGeneratedHtmlId({ prefix: "basicSelect" });
const basicSelectId = React.useId();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.useId() introduced in React 18. Any consumer on React 17 will crash at runtime.
Either keep using useGeneratedHtmlId from EUI (it's a standalone utility, not tied to EuiSelect), or drop React 17 from peer dependencies if that's intentional.

Prefer Vite import.meta env resolution with safe fallback to process.env, and restore EUI useGeneratedHtmlId to avoid React 18-only APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: kchawlani19 <kchawlan@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@kchawlani19
kchawlani19 force-pushed the fix/ui-vite-arrowdown-5429 branch from 026d8b3 to d1ae04e Compare August 11, 2026 05:26
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.

3 participants