Skip to content

Fix ES module directory import error in @object-ui/core#366

Merged
hotlong merged 3 commits intomainfrom
copilot/fix-action-run-issue-9637fba8-2fa1-4a5d-8b12-623bdd8c782a
Feb 3, 2026
Merged

Fix ES module directory import error in @object-ui/core#366
hotlong merged 3 commits intomainfrom
copilot/fix-action-run-issue-9637fba8-2fa1-4a5d-8b12-623bdd8c782a

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 3, 2026

Fix CI failure: ES module directory import error

The CI is failing with:

Error: Directory import '/home/runner/work/objectui/objectui/node_modules/.pnpm/@object-ui+core@0.3.1/node_modules/@object-ui/core/dist/types' is not supported resolving ES modules

Root Cause:
The @object-ui/core package.json has an export for "./types" that points to "./dist/types/index.js", but this export is never used in the codebase. The combination of the type-only re-export in src/index.ts and the unused package export is causing Node.js ES module resolution issues.

Solution:
Removed the unused "./types" export from packages/core/package.json. All types remain accessible via the main @object-ui/core import.

Additional Fix:
Fixed ESLint error in packages/data-objectstack/src/index.ts - wrapped case 'create' block in braces to comply with no-case-declarations rule.

Plan:

  • Remove unused "./types" export from packages/core/package.json
  • Verify build succeeds locally
  • Run tests to confirm the fix
  • Fix lint error in data-objectstack
  • Request code review (no issues found)
  • Run security scan with CodeQL (no issues found)

Verification:
✅ Build succeeds without errors
✅ Previously failing tests now pass:

  • packages/plugin-form/src/ObjectForm.msw.test.tsx
  • packages/plugin-grid/src/ObjectGrid.msw.test.tsx
  • apps/console/src/tests/BrowserSimulation.test.tsx (ES module error fixed, test passes locally)
    ✅ Lint now passes (no errors, only warnings)
    ✅ Code review completed - no issues
    ✅ CodeQL security scan - no vulnerabilities
Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21613399553/job/62286934340#step:9:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 3, 2026 2:34am
objectui-components Ready Ready Preview, Comment Feb 3, 2026 2:34am
objectui-crm-app Error Error Feb 3, 2026 2:34am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1766.37KB 417.57KB
core (index.js) 0.63KB 0.30KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 20.91KB 5.28KB
fields (index.js) 87.09KB 17.11KB
layout (index.js) 12.79KB 3.96KB
plugin-aggrid (AgGridImpl-BQ6tBvrq.js) 5.27KB 1.92KB
plugin-aggrid (ObjectAgGridImpl-CGFeGvOH.js) 11.44KB 3.52KB
plugin-aggrid (index-CLKYMco3.js) 19.20KB 4.89KB
plugin-aggrid (index.js) 0.22KB 0.16KB
plugin-calendar (index.js) 33.29KB 8.32KB
plugin-charts (AdvancedChartImpl-DQ5nNx27.js) 69.51KB 16.23KB
plugin-charts (BarChart-DTT3mpbI.js) 535.74KB 134.11KB
plugin-charts (ChartImpl-DkYg9drc.js) 8.78KB 3.11KB
plugin-charts (index-G7dGOmyT.js) 12.68KB 3.91KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-chatbot (index.js) 18.39KB 5.22KB
plugin-dashboard (index.js) 14.34KB 4.42KB
plugin-editor (MonacoImpl-hfdmoz6k.js) 18.15KB 5.59KB
plugin-editor (index-CuYbY6xb.js) 10.10KB 3.32KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-form (index.js) 15.22KB 4.91KB
plugin-gantt (index.js) 18.13KB 5.29KB
plugin-grid (index.js) 40.64KB 11.25KB
plugin-kanban (KanbanImpl-BtGLe0SN.js) 76.50KB 20.46KB
plugin-kanban (index-DLM6Mqdj.js) 12.99KB 4.08KB
plugin-kanban (index.js) 0.21KB 0.16KB
plugin-map (index.js) 16.78KB 5.12KB
plugin-markdown (MarkdownImpl-DufQ-eRU.js) 256.68KB 64.45KB
plugin-markdown (index-CrmE78vF.js) 9.63KB 3.17KB
plugin-markdown (index.js) 0.19KB 0.15KB
plugin-timeline (index.js) 25.86KB 6.70KB
plugin-view (index.js) 16.69KB 4.93KB
react (LazyPluginLoader.js) 1.10KB 0.58KB
react (SchemaRenderer.js) 3.28KB 1.30KB
react (index.js) 0.39KB 0.25KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 0.20KB 0.18KB
types (views.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong
Copy link
Copy Markdown
Collaborator

hotlong commented Feb 3, 2026

fix ci test and lint

@hotlong
Copy link
Copy Markdown
Collaborator

hotlong commented Feb 3, 2026

fix ci test and lint

@copilot

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 3, 2026

fix ci test and lint

@copilot

Fixed both CI test and lint issues:

  1. ES module directory import error - Removed unused ./types export from @object-ui/core/package.json (commit f0db35d)
  2. Lint error - Fixed no-case-declarations error in packages/data-objectstack/src/index.ts by wrapping case block in braces (commit a5b6a83)

✅ Lint now passes with 0 errors
✅ Tests pass locally including BrowserSimulation.test.tsx
✅ Code review and security scan complete

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1766.37KB 417.57KB
core (index.js) 0.63KB 0.30KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 20.92KB 5.28KB
fields (index.js) 87.09KB 17.11KB
layout (index.js) 12.79KB 3.96KB
plugin-aggrid (AgGridImpl-BQ6tBvrq.js) 5.27KB 1.92KB
plugin-aggrid (ObjectAgGridImpl-CGFeGvOH.js) 11.44KB 3.52KB
plugin-aggrid (index-CLKYMco3.js) 19.20KB 4.89KB
plugin-aggrid (index.js) 0.22KB 0.16KB
plugin-calendar (index.js) 33.29KB 8.32KB
plugin-charts (AdvancedChartImpl-DQ5nNx27.js) 69.51KB 16.23KB
plugin-charts (BarChart-DTT3mpbI.js) 535.74KB 134.11KB
plugin-charts (ChartImpl-DkYg9drc.js) 8.78KB 3.11KB
plugin-charts (index-G7dGOmyT.js) 12.68KB 3.91KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-chatbot (index.js) 18.39KB 5.22KB
plugin-dashboard (index.js) 14.34KB 4.42KB
plugin-editor (MonacoImpl-hfdmoz6k.js) 18.15KB 5.59KB
plugin-editor (index-CuYbY6xb.js) 10.10KB 3.32KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-form (index.js) 15.22KB 4.91KB
plugin-gantt (index.js) 18.13KB 5.29KB
plugin-grid (index.js) 40.64KB 11.25KB
plugin-kanban (KanbanImpl-BtGLe0SN.js) 76.50KB 20.46KB
plugin-kanban (index-DLM6Mqdj.js) 12.99KB 4.08KB
plugin-kanban (index.js) 0.21KB 0.16KB
plugin-map (index.js) 16.78KB 5.12KB
plugin-markdown (MarkdownImpl-DufQ-eRU.js) 256.68KB 64.45KB
plugin-markdown (index-CrmE78vF.js) 9.63KB 3.17KB
plugin-markdown (index.js) 0.19KB 0.15KB
plugin-timeline (index.js) 25.86KB 6.70KB
plugin-view (index.js) 16.69KB 4.93KB
react (LazyPluginLoader.js) 1.10KB 0.58KB
react (SchemaRenderer.js) 3.28KB 1.30KB
react (index.js) 0.39KB 0.25KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 0.20KB 0.18KB
types (views.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong hotlong marked this pull request as ready for review February 3, 2026 03:37
Copilot AI review requested due to automatic review settings February 3, 2026 03:37
@hotlong hotlong merged commit 7a041fc into main Feb 3, 2026
15 of 17 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a CI failure caused by an ES module directory import error in @object-ui/core and addresses an ESLint violation in @object-ui/data-objectstack.

Changes:

  • Removed unused "./types" export from @object-ui/core/package.json to fix ES module resolution error
  • Added braces to case 'create' block in packages/data-objectstack/src/index.ts to comply with ESLint no-case-declarations rule

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/core/package.json Removed unused "./types" export that was causing ES module directory import errors. Types remain accessible via main export.
packages/data-objectstack/src/index.ts Added braces to case 'create' block to fix ESLint no-case-declarations violation, consistent with other case blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants