You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected "'Type' is declared but its value is never read." error with jsdoc @import syntax #60908
bad.js:2:4 - error TS6133: 'Page' is declared but its value is never read.
2 * @import { Page } from "playwright"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in bad.js:2
so i expected the bug described in this issue to be fixed
However, i did the reproduction steps in the testcase repo (i updated TS to 5.8.3) https://github.com/DavidBruant/jsdoc-import-unused-testcase
and i can still see the same bug both in VSCodium (i checked the TS version being used in the bottom right corner) and tsc
I'm not sure where the problem is
Maybe i misunderstood the pull request
or the content of the 5.8.3 release
or the typescript release process
or maybe what's available on npm is slightly different
or something else?
If anyone sees this message, can you check whether the issue is fixed on your end, please? Thank you 🙏
This is fixed. With module and moduleResolution set to nodenext, allowJs, checkJs, and noUnusedLocals, a single JSDoc @returns {Foo} use no longer reports TS6133 for /** @import { Foo } from "./types.d.ts" */.
The last affected nightly was 5.9.0-dev.20250317; 5.9.0-dev.20250318, TypeScript 6.0.3, and current native TypeScript are clean. The change was made by PR #60921.
Activity
Andarist commentedon Jan 3, 2025
Interestingly, I can't repro it using the bug workbench: workbench
regseb commentedon Jan 11, 2025
I think I have the same problem.
bad.js👎good1.js👍good2.js👍package.json{ "name": "testcase", "version": "1.0.0", "type": "module", "dependencies": { "@types/node": "22.10.5", "playwright": "1.49.1", "typescript": "5.7.3" } }tsconfig.json{ "compilerOptions": { "module": "nodenext", "noUnusedLocals": true, "noEmit": true, "checkJs": true } }bad.jsgood1.jsgood2.jsnpm installnpx tscmantoni commentedon Mar 12, 2025
While we wait for the fix to be merged, here is a (surprising) workaround:
DavidBruant commentedon Apr 22, 2025
I see that TypeScript 5.8.3 has recently been released
When i compare 5.8.2 and 5.8.3, i can see the commit ee3dd72 which was the result of merging #60921 if i understand correctly
so i expected the bug described in this issue to be fixed
However, i did the reproduction steps in the testcase repo (i updated TS to 5.8.3)
https://github.com/DavidBruant/jsdoc-import-unused-testcase
and i can still see the same bug both in VSCodium (i checked the TS version being used in the bottom right corner) and
tscI'm not sure where the problem is
Maybe i misunderstood the pull request
or the content of the 5.8.3 release
or the typescript release process
or maybe what's available on npm is slightly different
or something else?
If anyone sees this message, can you check whether the issue is fixed on your end, please? Thank you 🙏
regseb commentedon Apr 24, 2025
I've tested my example #60908 (comment). I still get the error with TypeScript 5.8.3.
DavidBruant commentedon Apr 24, 2025
I'd love to reopen this issue but don't have the permissions to
Jake Bailey (@jakebailey) could you to reopen this issue, please?
regseb commentedon Apr 24, 2025
I created a testcase in Bug Workbench: https://www.typescriptlang.org/dev/bug-workbench/?noUnusedLocals=true&checkJs=true&moduleResolution=99&module=199&ts=5.8.3#code/PTAEAEFsHsBMFcA2BTAXKAdnZHkA8AXAKBAhgRQCVkBnaReAgS2g3S1h32NPCwFUM8GslgAZaAGMAhohroCAJ3jISYcJIAWySQGsAUvNBKVRNRABmTFBmmQ0xgJ4AHWgDpYbgjSL5n0RQInV1ALaGhQAF5QGiUmDABzM3NwKxs7BzTkNwArH2AAKgKiUAKIJkh-QNAAb1Dw0ABfUMVoSFAAIjdgAhd3T28OkoLgM0Li0ohFZAJ4RQwaWrDoRuHRi3gMSWZWUAAjaUUACgBKWpLQS+nZ+c6DgC8OgG4iVaJJVjoUN0RoBKODscTicnkA
There is no error when:
@module: nodenextand@moduleResolution: nodenextare removed: https://www.typescriptlang.org/dev/bug-workbench/?noUnusedLocals=true&checkJs=true&ts=5.8.3#code/PTAEA...o8tAAfoois used two times: https://www.typescriptlang.org/dev/bug-workbench/?noUnusedLocals=true&checkJs=true&moduleResolution=99&module=199&ts=5.8.3#code/PTAEA...Ep5AAfoois used in@type: https://www.typescriptlang.org/dev/bug-workbench/?noUnusedLocals=true&checkJs=true&moduleResolution=99&module=199&ts=5.8.3#code/PTAEA...EoDoA;is added after import: https://www.typescriptlang.org/dev/bug-workbench/?noUnusedLocals=true&checkJs=true&moduleResolution=99&module=199&ts=5.8.3#code/PTAEA...zmMgARyanCavanaugh commentedon Sep 19, 2026
This is fixed. With
moduleandmoduleResolutionset tonodenext,allowJs,checkJs, andnoUnusedLocals, a single JSDoc@returns {Foo}use no longer reports TS6133 for/** @import { Foo } from "./types.d.ts" */.The last affected nightly was
5.9.0-dev.20250317;5.9.0-dev.20250318, TypeScript 6.0.3, and current native TypeScript are clean. The change was made by PR #60921.