Skip to content

fix(rivetkit): prevent Turbopack from tracing sqlite-vfs dynamic import#4490

Open
NathanFlurry wants to merge 1 commit into03-23-fix_rivetkit_warn_when_manager_port_falls_back_to_a_different_portfrom
03-23-fix_rivetkit_prevent_turbopack_from_tracing_sqlite-vfs_dynamic_import
Open

fix(rivetkit): prevent Turbopack from tracing sqlite-vfs dynamic import#4490
NathanFlurry wants to merge 1 commit into03-23-fix_rivetkit_warn_when_manager_port_falls_back_to_a_different_portfrom
03-23-fix_rivetkit_prevent_turbopack_from_tracing_sqlite-vfs_dynamic_import

Conversation

@NathanFlurry
Copy link
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link

railway-app bot commented Mar 24, 2026

🚅 Deployed to the rivet-pr-4490 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud 😴 Sleeping (View Logs) Web Mar 25, 2026 at 7:46 am
website 😴 Sleeping (View Logs) Web Mar 24, 2026 at 5:39 pm
frontend-inspector 😴 Sleeping (View Logs) Web Mar 24, 2026 at 11:46 am
kitchen-sink ❌ Build Failed (View Logs) Web Mar 24, 2026 at 11:34 am
ladle ❌ Build Failed (View Logs) Web Mar 24, 2026 at 2:01 am
mcp-hub ✅ Success (View Logs) Web Mar 24, 2026 at 1:58 am

@claude
Copy link

claude bot commented Mar 24, 2026

PR Review: fix(rivetkit) prevent Turbopack from tracing sqlite-vfs dynamic import

Summary

The fix is correct and the approach is a well-known workaround for bundlers that statically analyze dynamic import strings. Overall this is a good minimal change.


Issues

Inline type annotation is verbose and duplicates existing type

The type annotation on line 31 is a very long one-liner that is hard to read. Worse, the return shape of SqliteVfsPool (acquire and shutdown) is already captured in the poolPromise field type at lines 9-13. These two definitions can drift silently. Consider extracting named local types SqliteVfsPoolInstance and SqliteVfsPoolCtor to avoid duplication, then reuse SqliteVfsPoolInstance in the field type too.

Webpack and other bundlers may warn on computed specifier

Webpack and other bundlers that perform static analysis of import() expressions will emit a warning when the specifier is not a string literal. This is usually just a warning and not a breakage, but worth validating that existing webpack/esbuild consumers do not regress.


Nits

  • The import type at line 1 is a type-only import, which TypeScript/bundlers strip at compile time, so it will not cause Turbopack to trace into the module graph. This is fine as-is.
  • No linked upstream Turbopack issue in the PR description. If one exists, linking it would help future readers understand when this workaround can be reverted.

Verdict

Approve with the suggestion to extract the inline type to improve readability and prevent future drift. The core fix is correct.

@NathanFlurry NathanFlurry force-pushed the 03-23-fix_rivetkit_prevent_turbopack_from_tracing_sqlite-vfs_dynamic_import branch from 0c1316c to f04465b Compare March 24, 2026 11:30
@NathanFlurry NathanFlurry force-pushed the 03-23-fix_rivetkit_warn_when_manager_port_falls_back_to_a_different_port branch from 9782f44 to 1bcf7a1 Compare March 24, 2026 11:30
@NathanFlurry NathanFlurry marked this pull request as ready for review March 24, 2026 11:30
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.

1 participant