nx
nx copied to clipboard
@nrwl/next:build, buildLibsFromSource option
trafficstars
Current Behavior
I believe the buildLibsFromSource rule on the @nrwl/next:build executor is being ignored. This repo contains 2 Nx packages, each with different typescript configs. Because of this when I run nx build my library is being rebuilt using my app's tsconfig, causing errors
Expected Behavior
@nrwl/next:build to use my library's build output instead of rebuilding with my app's typescript config rules
Steps to Reproduce
Here is a minimal repo I setup, steps to reproduce locally are in its README.md https://github.com/aaron-peloquin/nx-example
Here are the full steps to reproduce from scratch
- Create new nx workspace, generate nextjs app and a next library
- Alter the tsconfig.json in both packages so the library is more lenient in some way
- Implement the library's component to your application
- Modify the library's component to violate the app's more strict rule
- Set the nextjs app to have
buildLibsFromSource: false - Run
nx build, the library builds fine, but the application will fail because it's rebuilding the library with the application'stsconfig.jsonrules
Additionally, please let me know if there is some other way to build this project while respecting both package's typescript configuration
Failure Logs

Environment
NX Report complete - copy this into the issue template
Node : 14.17.2
OS : win32 x64
npm : 6.14.13
nx : 14.5.2
@nrwl/angular : Not Found
@nrwl/cypress : 14.5.2
@nrwl/detox : Not Found
@nrwl/devkit : 14.5.2
@nrwl/eslint-plugin-nx : 14.5.2
@nrwl/express : Not Found
@nrwl/jest : 14.5.2
@nrwl/js : 14.5.2
@nrwl/linter : 14.5.2
@nrwl/nest : Not Found
@nrwl/next : 14.5.2
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : 14.5.2
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.5.2
@nrwl/web : 14.5.2
@nrwl/workspace : 14.5.2
typescript : 4.7.4
---------------------------------------
Community plugins: