nestjs / swagger

OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas:

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting breakpoints doesn't work when using `@nestjs/swagger/plugin`

erikash opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

I've followed the instructions here:
https://docs.nestjs.com/openapi/cli-plugin

And updated my webpack.config.js file:

const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
const { composePlugins, withNx } = require('@nx/webpack');
const { merge } = require('webpack-merge');
const path = require('path');

module.exports = composePlugins(withNx(), (config, { options, context }) => {
  const finalConfig = merge(config, {
    module: {
      rules: [
        {
          test: /\.tsx?$/u,
          use: [
            {
              loader: 'ts-loader',
              options: {
                getCustomTransformers: (program) => ({
                  before: [
                    require('@nestjs/swagger/plugin').before({}, program),
                  ],
                }),
              },
            },
          ],
        },
      ],
    },
  });

  return config;
});

Minimum reproduction code

https://github.com/erikash/nx-debugging-test

Steps to reproduce

  1. Checkout my "Minimum reproduction code" repo
  2. npm install
  3. npx nx serve nx-debugging-test

Try to set a breakpoint anywhere and it wouldn't work.

Adding a debugger; statement does cause the debugger to break.

Expected behavior

Setting breakpoints should work.

Package version

7.0.10

NestJS version

10.0.2

Node.js version

18.14.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

This issue doesn't seem to be related to the @nestjs/swagger package.