Skip to content

Conversation

@112khanhamza
Copy link

Current Behavior

when I run the below nx workspace command
nx g @nx/express:app kafka-service --directory=apps/kafka-service --e2eTestRunner=none

the apps/kafka-service/webpack.config.json is generated with the below lines

const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
const { join } = require('path');

module.exports = {
output: {
path: join(__dirname, 'dist'),
...(process.env.NODE_ENV !== 'production' && {
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
}),
},
plugins: [
new NxAppWebpackPlugin({
target: 'node',
compiler: 'tsc',
main: './src/main.ts',
tsConfig: './tsconfig.app.json',
assets: ["./src/assets"],
optimization: false,
outputHashing: 'none',
generatePackageJson: true,
sourceMaps: true,
})
],
};

there is no such property in NxAppWebpackPluginOptions called sourceMaps, hence source maps are not generated
the correct property is sourceMap

Expected Behavior

module.exports = {
output: {
path: join(__dirname, 'dist'),
...(process.env.NODE_ENV !== 'production' && {
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
}),
},
plugins: [
new NxAppWebpackPlugin({
target: 'node',
compiler: 'tsc',
main: './src/main.ts',
tsConfig: './tsconfig.app.json',
assets: ["./src/assets"],
optimization: false,
outputHashing: 'none',
generatePackageJson: true,
sourceMap: true,
})
],
};

Related Issue(s)

Fixes #

@112khanhamza 112khanhamza requested a review from a team as a code owner November 2, 2025 09:53
@112khanhamza 112khanhamza requested a review from Coly010 November 2, 2025 09:53
@netlify
Copy link

netlify bot commented Nov 2, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 518791a
@vercel
Copy link

vercel bot commented Nov 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Nov 2, 2025 9:57am
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant