You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the original issue #8942 got closed, I've got some new info and I don't think my comment will be noticed there, I'm filing a new issue. Apologies if this is not the correct approach.
The original issue got closed with an advice to use @nrwl/web:file-server, but I think this should work with dev-server too.
it looks like the dev-server actually tries to handle this situation by generating a temporary tsconfig with paths remapped.
But the generated tsconfig doesn't seem to be actually used later on and that - I think - is why the serve fails.
As for the @nrwl/web:file-server executor, I tried to use it, but ran into some other problems. Because of defaultConfiguration=production, the serve target builds production configuration, though I need a development one during serve. I can overcome that by introducing explicit development configuration, but then also NODE_ENV is set to production by webpack plugin, so I have to explicitly set it before calling nx serve. Not quite developer-friendly.
Current Behavior
I have an app with strict:true setting, which uses a lib which is non-strict. To be able to build the app, I've set "buildLibsFromSource": false in the app config. That allows me to run nx build app without an error. But nx serve app still shows errors as if the lib was built during the serve - in strict mode.
Expected Behavior
nx serve app should use the independently built lib sources and finish without error, just like nx build app does.
Steps to Reproduce
create a workspace with a @nrwl/web:application and a buildable non-strict @nrwl/node:library.
make the app strict in its tsconfig.
add a code to the library that does something that wouldn't build in strict mode.
use the library in the app
set the "buildLibsFromSource" to false in app's project.json
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
Since the original issue #8942 got closed, I've got some new info and I don't think my comment will be noticed there, I'm filing a new issue. Apologies if this is not the correct approach.
The original issue got closed with an advice to use
@nrwl/web:file-server
, but I think this should work withdev-server
too.Looking at the code here
nx/packages/web/src/executors/dev-server/dev-server.impl.ts
Line 82 in b1e52b6
it looks like the dev-server actually tries to handle this situation by generating a temporary tsconfig with paths remapped.
But the generated tsconfig doesn't seem to be actually used later on and that - I think - is why the serve fails.
As for the
@nrwl/web:file-server
executor, I tried to use it, but ran into some other problems. Because of defaultConfiguration=production, the serve target builds production configuration, though I need a development one during serve. I can overcome that by introducing explicit development configuration, but then also NODE_ENV is set to production by webpack plugin, so I have to explicitly set it before calling nx serve. Not quite developer-friendly.Current Behavior
I have an app with strict:true setting, which uses a lib which is non-strict. To be able to build the app, I've set
"buildLibsFromSource": false
in the app config. That allows me to runnx build app
without an error. Butnx serve app
still shows errors as if the lib was built during the serve - in strict mode.Expected Behavior
nx serve app
should use the independently built lib sources and finish without error, just likenx build app
does.Steps to Reproduce
Repro repo:
https://github.com/ziacik/nx-bug-2
Environment
The text was updated successfully, but these errors were encountered: