Import Error Resolution Skill
Purpose
This skill resolves import/export errors in TypeScript/JavaScript modules systematically.
When to Use
- •When encountering "Export X doesn't exist in target module" errors
- •When facing "Module has no exported member" errors
- •When dealing with circular dependency issues
- •When mixing default and named exports causes issues
Approach
- •Analyze the Error: Identify the specific import/export issue
- •Trace the Module Chain: Follow import paths to identify where the issue originates
- •Check Export Definitions: Verify that the requested export exists in the source module
- •Verify Import Syntax: Ensure import statements match export patterns
- •Resolve Type vs Value Exports: Separate type-only imports when needed
- •Fix Circular Dependencies: Restructure imports to break cycles
- •Test Resolution: Verify the fix works
Process
The skill will:
- •Read the source file where the export is expected
- •Identify missing or incorrectly defined exports
- •Fix export definitions to match import requirements
- •Update import statements to match export patterns
- •Separate types and runtime code when needed
- •Create intermediate index files if necessary
Success Criteria
- •Import errors are resolved
- •All exports are properly accessible
- •No circular dependencies remain
- •Type and value exports are correctly separated