Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import path autocomplete regression: No classic resolution autocomplete when package does not have any "exports" but resolves fine #60902

Open
itsUndefined opened this issue Jan 2, 2025 · 0 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@itsUndefined
Copy link

itsUndefined commented Jan 2, 2025

🔎 Search Terms

"resolvePackageJsonExports", "no file autocomplete when importing internal package files with moduleResolution node16"

🕗 Version & Regression Information

This changed between versions 5.7.0-dev.20241031 and 5.7.0-dev.20241101

Confirmed the issue exists on typescript@next

⏯ Playground Link

https://codesandbox.io/p/devbox/qpxkh5?file=%2Findex.ts%3A13%2C1

💻 Code

// This resolves correctly but it doesn't autocomplete the /internal path even
// though the package @my/base (inside the folder base-package) does NOT have "exports" inside the package.json
import { INTERNAL_CONSTANT } from "@my/base/internal";

// try to update the import below to include the "/internal" at the end and see that it does not autocomplete

import { INTERNAL_CONSTANT as INTERNAL_CONSTANT2 } from "@my/base";

// try to set resolvePackageJsonExports to false inside tsconfig.json and try to update the import above again. 
// Autocomplete works AS EXPECTED.

🙁 Actual behavior

Autocomplete of internal folders of packages without "exports" does not work when "resolvePackageJsonExports": true

🙂 Expected behavior

Autocomplete of internal folders of packages without "exports" inside the package.json should be the same whether the resolvePackageJsonExports flag is enabled or not

Additional information about the issue

Regression must have happened between 10/31/2024 and 11/1/2024 based on my testing of the nightly builds. Could not provide a non-VM sandbox of the issue because it requires 2 npm packages to show the issue ( monorepo style )

@itsUndefined itsUndefined changed the title Import path autocomplete regression: No classic resolution autocomplete when package does not have any "exports" Import path autocomplete regression: No classic resolution autocomplete when package does not have any "exports" but resolves fine Jan 2, 2025
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Jan 3, 2025
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants