Skip to content

Using napi library within webpack angular app #73

@etkachev

Description

@etkachev

I created a rust library (with napi config of monodon). and trying to import a basic function to use within an angular Application that's using webpack mfe. When I try to build the angular app, I get the following error:

TypeError: Cannot read properties of undefined (reading 'data')
at /node_modules/@nx/webpack/src/utils/module-federation/dependencies.js:33:53

Issue seems to be happening on this line

Specifically when the target is cargo:napi. I'm assuming if it's not a npm source, then it's treating it like a workspace library, and expecting data.root to exist (but it doesn't so it fails).

Any way to add support so I can import these libraries into webpack/mfe applications?

Currently using monodon: 2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions