-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Typescript ignores package.json export maps #58890
Comments
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.90.1. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
@VSCodeTriageBot upgraded to 1.90.1 |
Without any more info, I'll point out the following information about the package from https://arethetypeswrong.github.io/?p=micro-eth-signer%400.9.1
Under node16, ESM files will think that you're trying to import a CJS file (because they resolve to a |
@DanielRosenwasser this looks very useful, thanks. I will fix "masquearading". RLP and SSZ modules are failing because of a typo from my end. Here's another package of mine: https://arethetypeswrong.github.io/?p=micro-key-producer%400.7.0 It says "💀 Resolution failed" for all node16. I assume this is simply because cjs files are located in Now, the question related to the first post is: which module resolution does typescript currently enforce by default? Is it node10? I mean, for the situation when there is no "tsconfig", and a random JS file is checked. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
mkdir meth && cd meth && npm init -y && npm i micro-eth-signer && touch a.mjs
import * as net from 'micro-eth-signer/net';
or any other module. VSCode would not see the module even though it's clearly specified in pkg.jsonI maintain many libraries and I export their functionality in sub-modules instead of importing everything into one big
index.js
file. This is useful and helps with tree-shaking. Seems like vscode doesn't support export maps in node.js.The text was updated successfully, but these errors were encountered: