Skip to content

Repro issue 996 #2

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions example.ts
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@

console.log('Some .ts code reproducing a bug');
declare const require: any;

// When this file is added to `getScriptFileNames`, `getProjectVersion` is not
// incremented.
// Therefore, when ts-node tries to get the transpiled output of this file,
// TypeScript erroneously uses the old `Program` instance where this file is considered
// "external" and therefore is not emitted.
import './src/node_modules/causes-problem';

require('./src/no-problem');
2 changes: 2 additions & 0 deletions src/no-problem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
console.log('this file will be transpiled no problem');
export const foo = 123;
2 changes: 2 additions & 0 deletions src/node_modules/causes-problem.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ts-node": {
"skipIgnore": true
}
}