Skip to content

Dependency Matching ​

This page explains how the platform decides whether a component "can be rendered" when its dependencies differ from your local versions.

Why matching is needed ​

When a component is previewed on the platform, it uses the dependencies already installed in your local project. In practice this often looks like:

  • The component requires echarts@5.2.3
  • You have echarts@5.0.0 installed locally

If versions had to match exactly, a large number of components would be unusable. The platform therefore offers five matching rules, and you decide how loose they should be.

The five rules ​

Under "Settings → Preview Rules → Dependencies" you can set each package in dependencies and devDependencies separately:

RuleHow it is judgedWhen it fitsIndicator colour
AutoNo version restriction; use the locally installed versionDefault value, prioritises renderabilityGray
Installed onlyOnly requires the package to be installed locally, ignoring the versionQuick preview, not production validationGreen
MajorSame major versionBalances compatibility and stabilityBlue
Major + minorSame major and minor versionSensitive about versionsOrange
ExactIdentical version numberStrict version controlRed

Rules get stricter further down the table. Each item on the settings page has a dot in the matching colour for quick identification.

Version comparison example ​

Assume the component depends on echarts@5.2.3:

Local versionAutoInstalled onlyMajorMajor + minorExact
5.0.0UseUseUseSkipSkip
5.2.0UseUseUseSkipSkip
5.2.3UseUseUseUseUse
6.0.0UseUseSkipSkipSkip
Not installedSkipSkipSkipSkipSkip

Default behaviour ​

  • Dependencies without their own configuration use Auto.
  • A dependency that is not installed at all locally matches no rule and must be installed first.
  • The framework is determined by the component source: importing vue renders as Vue, importing react renders as React; importing both cannot be rendered.

Four-step troubleshooting ​

1. Switch to "All"

Confirm the component exists instead of having been filtered out of the list.

2. Check the dependency status

On the detail page:

  • Green: matched successfully
  • Yellow: versions differ, you can try to run it
  • Red: mismatched or missing

3. Install missing dependencies

bash
npm install <package-name>

Refresh the page after installing so the check runs again.

4. Loosen the rules

When the version difference does not affect functionality, relax the rule from "Exact" to "Major" or "Auto".

Scope of the rules ​

Dependency matching only affects online preview. Running a downloaded component uses your project's dependencies and has nothing to do with these rules.

Next steps ​

Components uploaded by users are open source