Skip to content

Can't debug shared libs with native federation + nx #865

@pachyderme

Description

@pachyderme

With what library do you have an issue?

native-federation

Reproduction of the bug/regression with instructions

Hello, I have an application based on NX and native federation. Breakpoints work in applications but not in shared libraries.

Expected behavior

When I set a breakpoint in vscode, the breakpoint must be reached in the correct .ts file in my project.

Versions of Native/Module Federation, Angular, Node, Browser, and operating system

latest (in my poc project) and same bug with Angular 19.x (wich I target in my real project)

Other information

How to reproduce :

Create a nx workspace with esbuild:
npx create-nx-workspace

Add an app
Add "libs" folder and add an lib (through nx/library generator)

Inside the lib, add a component with onInit and set "debugger" keyword in it.
Add a route inside the app with loadcomponent through you new component.

run app through npx nx run myapp:serve.
The breakpoint should be triggered in right file (you can edit the file directly).

Add native federation package, use the init generator for host for this app. Run the app, the breakpoint is triggered but you can't edit it because it's not the right file. You can add remote apps as well, the bug is the same.

So, I am missing some config ?

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions