-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@nx/esbuild tsconfig.app.json paths not included in output #22238
Comments
After some investigations, it seems that the getTsConfigCompilerPaths function from function getTsConfigCompilerPaths(context: ExecutorContext): {
[key: string]: string[];
} {
const tsconfigPaths = require('tsconfig-paths');
const tsConfigResult = tsconfigPaths.loadConfig(getRootTsConfigPath(context));
if (tsConfigResult.resultType !== 'success') {
throw new Error('Cannot load tsconfig file');
}
return tsConfigResult.paths;
} And the getRootTsConfigPath does not include the tsConfig options from project.json esbuild options function getRootTsConfigPath(context: ExecutorContext): string | null {
for (const tsConfigName of ['tsconfig.base.json', 'tsconfig.json']) {
const tsConfigPath = path.join(context.root, tsConfigName);
if (existsSync(tsConfigPath)) {
return tsConfigPath;
}
}
throw new Error(
'Could not find a root tsconfig.json or tsconfig.base.json file.'
);
} |
any news? |
I think this is the cause of my issue as well
} Error: Invalid config file due to following: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were skipType check to bypass: NX Build failed with 1 error: The most basic tsconfig.json
|
This is working as intended, as Nx treats the root tsconfig's There is a proposal to allow merging options, but it is still just a proposal: microsoft/TypeScript#57486. Any changes in this setup will require a larger design discussion. Feel free to open a discussion topic on it, as I don't see one that exists already. Alternatively, you could use npm/yarn/pnpm workspaces to link your packages, which avoids |
@hamishrose1 That sounds like a different issue. Make sure that your include/exclude is defined on the If you continue to run into issue, please open a new issue with a repro linked so we can investigate. Thanks! |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Path aliases are not correctly resolved when building application with options bundle "false" and format "cjs" which result in
This is because the output of the builded main.js does not include module from tsconfig.app.json
Expected Behavior
I would expect not having an error when serving with custom application paths aliases
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
10.2.4
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: