Skip to content

NF SourceMap Support #764

Open
Open
@rribeiro93k

Description

@rribeiro93k

With what library do you have an issue?

native-federation

Reproduction of the bug/regression with instructions

In my angular project with Native Federation, I can successfully install a library having souceMap (.js.map) files but when I try to run the application by npm start I got some errors from console indicating some interpretation problem:

✘ [ERROR] No loader is configured for ".map" files: node_modules/@some/library/dist/esm/some-component.js.map

    node_modules/@some/library/dist/esm/index-6dd6ff9f.js:3890:2:
      3890 │   `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then(importedModule => {

This error appears for each .map file

If i'm not mistaken, mathjs generate dist with sourceMap if someone wants to try this behavior.

For now, to work with this scenario I've created an postinstall script to remove this files:
"postinstall": "rm -Rf $(find node_modules/@some/library/ -name *.js.map) && echo '@some/library: map files removed ✔'"

Expected behavior

Runs application with sourcemap files

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

Native Federation: v18.2.2
Angular: v18.2.0
Node: v20
Operation System: Windows + Wsl2

Other information

No response

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