Skip to content

Getting main.ts:6 Error: Dynamic require of "buffer/" is not supported at chunk-4H3CUAZM.js:31:11 when trying to use object-sizeof library in native federation #103

@JijiyaT

Description

@JijiyaT

We have an angular application with version 20 and when we are converting our repos to native federated mfe with native federation V 20,We are facing below issue with object-sizeof library as it only supports node not browser,While federation we are getting below errors.

main.ts:6 Error: Dynamic require of "buffer/" is not supported
at chunk-4H3CUAZM.js:31:11
at node_modules/object-sizeof/indexv2.js (byte_size.js:21:1)
at __require2 (chunk-4H3CUAZM.js:49:52)
at indexv2.js:138:1

We are using it as import sizeof from 'object-sizeof';

to have this issue reproducible, we just need to import object-sizeof and use it in the code.
Below github code: https://github.com/JijiyaT/angular-nativefederation

Is there any way i can use this lib for ES Module.Any suggestions/feedback is helpful.

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