Skip to content

Misplaced breakpoints after ssrLoadModule #7487

@GauBen

Description

@GauBen

Describe the bug

Hello there, I have a bug in a very exotic setup.

I'm running a nest application in vite with vite-plugin-node. Everything works fine for my needs, except debugging.

Let's consider the file accounts.controller.ts, with a breakpoint on line 11:

image

When transpiled to TypeScript, the corresponding line is line 22:

image

However, ssrLoadModule produces a slightly different virtual file:

image

As you can see here, the breakpoint triggers on line 22 (in fact 23) and not on the right line.

Might be related to #5834.

I tried patching vite-plugin-node/server/index.ts with the following line without success.

const appModule = await server.ssrLoadModule(config.appPath, {fixStacktrace: true});

Reproduction

https://git.inpt.fr/inp-net/bonfire/-/tree/vite-issue/

System Info

vite: 2.8.6
vite-plugin-node: 0.0.18
yarn: 3.2.0 (with node_modules)

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions