Skip to content

Conversation

Rajdeepc
Copy link
Contributor

@Rajdeepc Rajdeepc commented Sep 22, 2025

Description

Problem

TypeScript compilation fails with moduleResolution: "bundler" and allowImportingTsExtensions: true due to inconsistent import patterns in the library. The specific error was:

error TS2307: Cannot find module '@spectrum-web-components/overlay/src/AbstractOverlay' or its corresponding type declarations.

Root Cause

The import in packages/picker/src/InteractionController.ts was missing the .js extension:

// Before (causing the error)
import { AbstractOverlay } from '@spectrum-web-components/overlay/src/AbstractOverlay';

Solution

Added the missing .js extension to ensure consistent module resolution:

// After (fixed)
import { AbstractOverlay } from '@spectrum-web-components/overlay/src/AbstractOverlay.js';

Impact

✅ Fixes TypeScript compilation errors for users with modern TypeScript configurations
✅ Ensures compatibility with both moduleResolution: "node" and moduleResolution: "bundler"
✅ Maintains backward compatibility - no breaking changes
✅ Consistent with existing import patterns throughout the codebase

Motivation and context

Related issue(s)

  • fixes SWC-1254

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Descriptive Test Statement

    1. TypeScript compilation passes with both traditional and modern module resolution settings
    2. No impact on existing functionality
    3. Declaration files (.d.ts) generate correctly

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Copy link

changeset-bot bot commented Sep 22, 2025

⚠️ No Changeset found

Latest commit: 19b184b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rajdeepc Rajdeepc marked this pull request as ready for review September 22, 2025 06:32
@Rajdeepc Rajdeepc requested a review from a team as a code owner September 22, 2025 06:32
Copy link
Contributor

github-actions bot commented Sep 22, 2025

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5746

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link
Contributor

Tachometer results

Currently, no packages are changed by this PR...

@Rajdeepc Rajdeepc linked an issue Sep 22, 2025 that may be closed by this pull request
1 task
@Rajdeepc Rajdeepc added the ready-for-merge Will auto-update until merged label Sep 23, 2025
@rubencarvalho rubencarvalho merged commit 33626fc into main Sep 23, 2025
24 checks passed
@rubencarvalho rubencarvalho deleted the rajdeep/SWC-1254 branch September 23, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Will auto-update until merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: incorrect specifier for AbstractOverlay in Picker InteractionController
3 participants