-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
Typescript plugin fails to compile the entry point when there is at least one invalid TypeScript file somewhere is the working directory #1652
Comments
While investigating the issue, I stumbled upon a very strange part of the code that seems to handle non-yet discovered files but always ends up throwing an error: plugins/packages/typescript/src/index.ts Line 157 in 33174f9
if (!parsedOptions.fileNames.includes(fileName)) {
// Discovered new file that was not known when originally parsing the TypeScript config
parsedOptions.fileNames.push(fileName);
} There, the newly discovered file is added to What is the rational that drives this part of the code? Can someone guide me to the test that covers this part of the code? |
Expected Behavior
In the reproduction repository, we find 3 TS files:
src/index.ts
, the entry pointsrc/valid.ts
, imported by the entry pointsrc/invalid.ts
, containing non valid TypeScript syntax and imported by neithersrc/index.ts
orsrc/valid.ts
When executing rollup on
src/index.ts
, the build should be successful since thesrc/invalid.ts
file is not imported.Actual Behavior
The build is unsuccessful, and the error suggests that
src/invalid.ts
is syntax-checked by the plugin even though it is not part of the dependency graph of the entry point:Additional Information
Note that the behaviour of
tsc
is correct in that regard:No error is emitted and
src/index.ts
andsrc/valid.ts
are successfully compiled.So the error is coming from the plugin, not from the TypeScript compiler.
The text was updated successfully, but these errors were encountered: