-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Unclosed 'new Set(' wrecks resolutions to packages in nodenext #46373
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Is this really specific to |
It's probably not, but this is already pretty minimal for someone to investigate. |
I have been trying 4.5 for three days on one of our libraries, and I repeatedly get similar errors while modifying code in types or expressions. As with your step 8, those errors usually go away with the next edits/saves.
This seems to happen not only in TS Server connected to vscode, but I have also found it in the Here is one particular weird example I came across. I have removed most of the other stuff, but it still shows the issues (sometimes) when repeatedly doing one of the following and waiting for the TS Server to catch up:
Repository: https://github.com/pyBlob/ts_module_resolution_error import { baseZBoolean, ZBoolean } from "./ZBoolean.js";
export type Not<value extends ZBoolean> = value extends ZBoolean<never>
? ZBoolean<never>
: value extends ZBoolean<true>
? ZBoolean<false>
: value extends ZBoolean<false>
? ZBoolean<true>
: ZBoolean;
export const Not = <value extends ZBoolean>(value: value): Not<value> =>
("sample" in value && value.sample !== undefined
? value.sample /**/.length === 0
? baseZBoolean.create([])
: value.sample.every((sample) => sample === true)
? baseZBoolean.create([false])
: value.sample.every((sample) => sample === false)
? baseZBoolean.create([true])
: baseZBoolean
: baseZBoolean) as any;
// const justaconstant = 5 |
#46396 seems related |
I’ve seen this every time I’ve tried to use |
Create a new package
npm install node-fetch
(or whatever package)Set up a tsconfig.json with nodenext as the module mode.
Add the following code
At the cursor
/**/
, type innew Set(
Notice that the resolution to
node-fetch
is now borked.Complete the parentheses on the other side
The resolution to
node-fetch
is likely still failing. If so, try to type a;
. That may fix it.The text was updated successfully, but these errors were encountered: