Skip to content

fix: dashboard esm-env runtime alias#416

Open
kaanyagci wants to merge 2 commits into
Openpanel-dev:mainfrom
kaanyagci:agent/fix-dashboard-esm-env-runtime
Open

fix: dashboard esm-env runtime alias#416
kaanyagci wants to merge 2 commits into
Openpanel-dev:mainfrom
kaanyagci:agent/fix-dashboard-esm-env-runtime

Conversation

@kaanyagci

@kaanyagci kaanyagci commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • add an esm-env package alias inside the self-hosted dashboard SSR bundle when pnpm emits only esm-env-runtime
  • verify during the dashboard image build that import("esm-env") resolves with the expected Node runtime flags

Root cause

@number-flow/react imports esm-env at runtime. The workspace override resolves that dependency to esm-env-runtime, and the standalone Nitro output copies the target package directory into .output/server/node_modules without preserving the esm-env alias. In the published self-hosted dashboard image this causes SSR routes using NumberFlow to fail with ERR_MODULE_NOT_FOUND.

Summary by CodeRabbit

  • Bug Fixes
    • Improved production runtime compatibility for server deployments to better handle environment-specific ESM behavior.
    • Added a build-time validation check to detect mismatches in module behavior before shipping, reducing the chance of runtime failures.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d1e9f11b-3076-4e61-91fc-50d8021989b4

📥 Commits

Reviewing files that changed from the base of the PR and between 4e5b3d1 and 3c92912.

📒 Files selected for processing (1)
  • apps/start/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/start/Dockerfile

📝 Walkthrough

Walkthrough

The production Dockerfile patches the standalone Nitro server with an esm-env package when needed, then validates its imported environment flags during the runner image build.

Changes

Runtime patch

Layer / File(s) Summary
Create and validate esm-env runtime package
apps/start/Dockerfile
The production image build creates esm-env from esm-env-runtime when absent, writes its package metadata, and checks the imported BROWSER and NODE values.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing the dashboard's esm-env runtime alias.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CLAassistant

CLAassistant commented Jul 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kaanyagci
kaanyagci force-pushed the agent/fix-dashboard-esm-env-runtime branch from a66c2ef to 4e5b3d1 Compare July 15, 2026 20:35
@kaanyagci
kaanyagci marked this pull request as ready for review July 15, 2026 20:41
@kaanyagci kaanyagci changed the title Fix dashboard esm-env runtime alias fix: dashboard esm-env runtime alias Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/start/Dockerfile`:
- Line 142: Update the inline Node validation command in the Dockerfile to also
require DEV === false, alongside the existing BROWSER and NODE checks. Use
node:assert with top-level await as appropriate so mismatches produce
informative assertion errors instead of only process.exit(1).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 072f8c48-f58a-46f0-9751-f15a8f004dcb

📥 Commits

Reviewing files that changed from the base of the PR and between f72310c and 4e5b3d1.

📒 Files selected for processing (1)
  • apps/start/Dockerfile

Comment thread apps/start/Dockerfile Outdated
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.

2 participants