-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 4.0.3 (also happens in typescript@next
)
private name,Declaration emit,block declaration emit,TS9006
a very simple code sample -
https://github.com/euclideansphere/private-declaration-issue
// utils/errors.js
class FancyError extends Error {
constructor(status) {
super(`error with status ${status}`);
}
}
module.exports = {
FancyError
}
// utils/index.js
// issue arises here on compilation
const errors = require("./errors");
module.exports = {
errors
}
Expected behavior:
(master)⚡ % tsc # should run clean, exit with code 0
Actual behavior:
(master)⚡ % tsc ~/projects/private-declaration-issue
utils/index.js:1:1 - error TS9006: Declaration emit for this file requires using private name 'FancyError' from module '"/Users/austin/projects/private-declaration-issue/utils/errors"'. An explicit type annotation may unblock declaration emit.
1 const errors = require("./errors");
~~~~~
Found 1 error.
Playground Link:
https://github.com/euclideansphere/private-declaration-issue
Related Issues:
#9865 - seems to be an issue with "A inherits B but only A is exported", but in this case B is a global and adding it as an export doesn't resolve the issue.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issue