Skip to content

Fix Vite build failure: suppress optional driver-memory dynamic import warning#316

Merged
hotlong merged 3 commits intocopilot/release-version-update-againfrom
copilot/update-action-step-in-github
Jan 27, 2026
Merged

Fix Vite build failure: suppress optional driver-memory dynamic import warning#316
hotlong merged 3 commits intocopilot/release-version-update-againfrom
copilot/update-action-step-in-github

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 27, 2026

Vite build for examples/msw-react-crud fails with unresolved import error for @objectstack/driver-memory. The runtime kernel uses an optional dynamic import for backward compatibility:

// packages/runtime/src/kernel.ts:55
try {
  const { InMemoryDriver } = await import('@objectstack/driver-memory');
  // ...
} catch (e) {
  // Ignore if not present
}

When bundling, Vite encounters this in the transpiled output and treats it as an error, despite the driver being explicitly imported elsewhere in the application.

Changes

  • Add rollupOptions.onwarn handler to suppress UNRESOLVED_IMPORT warnings for @objectstack/driver-memory
  • The driver is already bundled via explicit import in src/mocks/browser.ts:9
// examples/msw-react-crud/vite.config.ts
rollupOptions: {
  onwarn(warning, warn) {
    if (
      warning.code === 'UNRESOLVED_IMPORT' &&
      warning.message.includes('@objectstack/driver-memory')
    ) {
      return;
    }
    warn(warning);
  }
}
Original prompt

引用: https://github.com/objectstack-ai/spec/actions/runs/21391344024/job/61578773332#step:8:1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 27, 2026

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

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 27, 2026 9:29am

Request Review

…ud vite build

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update action step in GitHub workflow Fix Vite build failure: suppress optional driver-memory dynamic import warning Jan 27, 2026
Copilot AI requested a review from hotlong January 27, 2026 09:32
@hotlong hotlong marked this pull request as ready for review January 27, 2026 09:33
Copilot AI review requested due to automatic review settings January 27, 2026 09:33
@hotlong hotlong merged commit f08b23d into copilot/release-version-update-again Jan 27, 2026
6 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 Vite build failure in the examples/msw-react-crud example by suppressing warnings for an optional dynamic import. The runtime kernel attempts to dynamically import @objectstack/driver-memory as a backward compatibility fallback, but Vite treats this as an error during bundling even though the driver is explicitly imported and bundled elsewhere in the application.

Changes:

  • Added a rollupOptions.onwarn handler to suppress UNRESOLVED_IMPORT warnings specifically for @objectstack/driver-memory

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