Repository navigation
fix(dashboard): rename backendFlag util to avoid case-only module collision - #2823
Closed
Geek-Icebreaker wants to merge 2 commits into
Closed
Geek-Icebreaker wants to merge 2 commits into
Geek-Icebreaker wants to merge 2 commits into
Conversation
…lision On case-insensitive filesystems (macOS/Windows), Vite's dev server resolves "./BackendFlag" to backendFlag.ts because ".ts" is probed before ".tsx". The BackendFlag component is then imported as a module without a default export and the page fails with "does not provide an export named 'default'". Rename the utility module to backendFlagModel.ts (and its test file) and update the imports in BackendFlag.tsx. No runtime behavior changes.
# Conflicts: # dashboard/src/pages/Experts/components/BackendFlag.tsx
Contributor
|
请把这个变更重新提交到 Please open this change against |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On case-insensitive filesystems (macOS/Windows), Vite's dev server resolves
./BackendFlagtobackendFlag.tsbecause.tsis probed before.tsx. TheBackendFlagcomponent is then imported as a module without a default export, and/admin/usersfails with:The requested module '/src/pages/Experts/components/backendFlag.ts' does not provide an export named 'default'This PR renames the utility module to
backendFlagModel.ts(and its test file) and updates the imports inBackendFlag.tsxand the test. No runtime logic or public exports are changed.Root cause
BackendFlag.tsx(React component with a default export) andbackendFlag.ts(utility module with named exports only) differ only by case. Both were introduced byd7cd8027(feat: record the model system prompt and harden chat, connectors, and images #2700, 2026-11-01)..mjs → .js → .mts → .ts → .jsx → .tsx → .json, so.tsis probed before.tsx.AgentCard.tsximports it extensionless:import BackendFlag from "./BackendFlag"../BackendFlag.tsmatches the on-diskbackendFlag.ts. The default import is therefore resolved to a module with only named exports, producing the runtime error./admin/users→UsersListPanel→AgentCard→./BackendFlag, which is why the error only appears on that page.octop runserves the pre-builtsrc/octop/dashboard/bundle, where imports are already resolved at build time;BackendFlagmay not have been visited.Fix
backendFlag.tstobackendFlagModel.tsand the test file accordingly, so the utility module no longer shares the same name as the component except for case.BackendFlag.tsxandbackendFlagModel.test.ts.resolveBackendFlag/backendFlagIcon/BackendFlagIconstay the same.Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Test plan
make allpasses locallyCommands run: