🔎 Search Terms
tripleslash directive modules reference
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
https://www.typescriptlang.org/play?target=99&moduleResolution=3&module=100&esModuleInterop=false#code/PTAEAEFsHsBMFcA2BTAXKAcnZBGAbALABQIEMCKASsgM7SLwAuAltAHbpay6EljjcAxogCGAJxEt26RmPjJixEGAA8Y5ADNk6toOShGATwAOtALwAiNtguhgAPkVFmkY9DGNQAbwCqlADIAvqAaYtCQoADk1tyo8GKIkQDcxC5uHt4AogBuyGyMmZDMjIzawaHhUTFoyLn5NMmpru6eXgBC8BpaYuVhEdHYqABGnd2NRMTIAB7pnoLsNJ6Lo+gA2n7+APwANKA5eQVFJdo7oB1dJwC6oGagq2zIAO6gGwAUkQAWJcY0qCCPAIAdEZTDRBGJmMZGKI2ABzQHuWHAYyiQyRACUlyAA
💻 Code
// @module: Node16// @moduleResolution: Node16// @declaration: true/// <reference types="node" />import{URL}from'node:url';import{EventEmitter}from'node:events';import{Buffer}from'node:buffer';exportconststuff: [URL?,EventEmitter?,Buffer?]=[newURL('https://www.typescriptlang.org/play')]🙁 Actual behavior
/// <reference types="node" resolution-mode="require"/>/// <reference types="node" resolution-mode="require"/>/// <reference types="node/url.js" />/// <reference types="node/ts4.8/url.js" />/// <reference types="node/events.js" />/// <reference types="node/ts4.8/events.js" />/// <reference types="node/buffer.js" />/// <reference types="node/ts4.8/buffer.js" />import{URL}from'node:url';import{EventEmitter}from'node:events';import{Buffer}from'node:buffer';exportdeclareconststuff: [URL?,EventEmitter?,Buffer?];🙂 Expected behavior
I'd expect only a single /// <reference types="node" resolution-mode="require"/> to be emitted.
Additional information about the issue
Note that types acquisition and switching between ESM/CJS modes is a little bit unreliable in the TS playground so you might have to "touch" the repro to "refresh" the DTS output
🔎 Search Terms
tripleslash directive modules reference
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?target=99&moduleResolution=3&module=100&esModuleInterop=false#code/PTAEAEFsHsBMFcA2BTAXKAcnZBGAbALABQIEMCKASsgM7SLwAuAltAHbpay6EljjcAxogCGAJxEt26RmPjJixEGAA8Y5ADNk6toOShGATwAOtALwAiNtguhgAPkVFmkY9DGNQAbwCqlADIAvqAaYtCQoADk1tyo8GKIkQDcxC5uHt4AogBuyGyMmZDMjIzawaHhUTFoyLn5NMmpru6eXgBC8BpaYuVhEdHYqABGnd2NRMTIAB7pnoLsNJ6Lo+gA2n7+APwANKA5eQVFJdo7oB1dJwC6oGagq2zIAO6gGwAUkQAWJcY0qCCPAIAdEZTDRBGJmMZGKI2ABzQHuWHAYyiQyRACUlyAA
💻 Code
🙁 Actual behavior
🙂 Expected behavior
I'd expect only a single
/// <reference types="node" resolution-mode="require"/>to be emitted.Additional information about the issue
Note that types acquisition and switching between ESM/CJS modes is a little bit unreliable in the TS playground so you might have to "touch" the repro to "refresh" the DTS output