fix: detect missing deps in custom file extensions on first install #10095
+39
−0
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.
Problem
When importing a component that uses a custom env (e.g., Vue env) with custom file extension detectors (e.g.,
.vuefiles), the first install after import fails to detect dependencies imported in those custom files. A secondbit installis required to detect and install the missing packages.Reproduction:
The issue occurs because:
This is a follow-up fix to #10044 which enabled loading components with seeders during dependency detection, but didn't handle the case where the env itself needs to be installed first.
Solution
Track failed envs before install (scopes/workspace/install/install.main.runtime.ts:372-374):
Re-check for missing deps after install (scopes/workspace/install/install.main.runtime.ts:491-519):
When
addMissingDepsis enabled and there were envs that failed to load before install:Enable during import (scopes/component/component-writer/component-writer.main.runtime.ts:114-118):
addMissingDeps: truewhen calling install during importTest Plan
Tested with
learnbit-vue.graphql/user-appwhich uses.vuefiles:bit import learnbit-vue.graphql/user-appnow correctly installs missing Vue composable dependency on first importbit import -xfollowed bybit install --add-missing-depsworks correctlybit statusshows no issues after importThe fix ensures that custom file extension dependencies are detected and installed on the first import, eliminating the need for a second install.