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

nodenext moduleResolution can't resolve package types correctly #53759

Closed
tjx666 opened this issue Apr 12, 2023 · 7 comments
Closed

nodenext moduleResolution can't resolve package types correctly #53759

tjx666 opened this issue Apr 12, 2023 · 7 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@tjx666
Copy link

tjx666 commented Apr 12, 2023

Bug Report

🔎 Search Terms

nodenext, moduleResolution, exports

🕗 Version & Regression Information

happen on [email protected] to typescript@next

image

⏯ Playground Link

Playground link with relevant code

The playground seems can't save my tsconfig.
You need to set:

  • target: ESNext
  • module: nodenext

💻 Code

import vitePluginVue2 from '@vitejs/plugin-vue2';

console.log(vitePluginVue2());

🙁 Actual behavior

This expression is not callable.
  Type 'typeof import("file:///node_modules/@vitejs/plugin-vue2/dist/index")' has no call signatures.(2349)

🙂 Expected behavior

No compile error

@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Apr 13, 2023
@RyanCavanaugh
Copy link
Member

I don't think nodenext module resolution is just uniformly broken -- much more likely this is a misconfigured package. Can you be more specific about why you think this is a wrong result, and include a sample repo to demonstrate?

@RyanCavanaugh
Copy link
Member

Looks like this is just how vitejs has decided to ship their code. See vitejs/vite-plugin-react#104 and specifically vitejs/vite-plugin-react#104 (comment) / vitejs/vite-plugin-react#104 (comment)

@RyanCavanaugh RyanCavanaugh added External Relates to another program, environment, or user action which we cannot control. and removed Needs More Info The issue still hasn't been fully clarified labels Apr 13, 2023
@tjx666
Copy link
Author

tjx666 commented Apr 14, 2023

I just want to to know why tsc throw this error when I using moduleResolution:nodenext. The package had already configured the types using package.json exports and the .d.ts is also exits.

Can you be more specific about why you think this is a wrong result, and include a sample repo to demonstrate?

Why not click the playground link.

@RyanCavanaugh
Copy link
Member

We'll have some new module docs soon that will explain all of this in more detail.

@RyanCavanaugh RyanCavanaugh closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2023
@MrHBS
Copy link

MrHBS commented May 23, 2023

@RyanCavanaugh How soon? This all is just extremely confusing

@RyanCavanaugh
Copy link
Member

@MrHBS probably a preview version available in a couple weeks

@RyanCavanaugh
Copy link
Member

@MrHBS see #52593 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

3 participants