I have an integrated NX workspace that has an Angular application and a Nativescript app. I am trying to add a Nest.js application via @nx/nest. Whenever I added the new app, it installs the @nx/webpack plugin and adds that plugin to the nx.json. I notice that Nativescript is using its own @nativescript/webpack module.
Anytime that I try to build or serve any of the apps, its immediately throws a type error since it is trying to use @nx/webpack with Nativescript... Here is the error
NX Unable to create nodes for apps/nativescript-mobile-app/webpack.config.js using plugin @nx/webpack/plugin.
Inner Error: TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
Has anyone run into this issue with conflicting Webpack modules? Is it possible to specify which apps use NX plugins?
@rthames62 mentioned his issue on the official Discord server and provided me his
nx.json& also his NestJSproject.json.If anyone else here is facing this issue;
Adding
@nx/nestseems to be adding a global@nx/webpack/plugininto yournx.jsoninstead of adding it into the NestJSproject.jsonas target:Just remove the
@nex/webpack/pluginentry.Now add this to your NestJS
project.json:If you face issues with serving your NestJS app, then change the
servetarget of your NestJSproject.jsonto:Keep in mind to change
YOUR NEST APPwith the name of your NestJS app.Glad that I could help.