Skip to content

Getting node related errors when using pptxgenjs latest version in NX Angular Microfrontend setup #1419

@imPranavKale

Description

@imPranavKale

I am using NX Angular microfrontend application. @nx/angular: 20.8.0, Angular: 19.28

I am trying to use pptxgenjs: 4.0.1 in my application. During build I am getting following error:

node:fs - Error: Module build failed: UnhandledSchemeError: Reading from "node:fs" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

node:https - Error: Module build failed: UnhandledSchemeError: Reading from "node:https" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

Error: Can't resolve 'node-modules/pptxgenjs/dist/pptxgen.bundle.js' in 'C:\Codebase\ui-ppt'

Everything works fine when I use pptxgenjs: 3.11.0.
I can see from there documentation that support for node was added in version 4.0.0 and above.

I tried adding following code to my webpack.config:

export default withModuleFederation(config, {
  resolve: {
    fallback: {
      fs: false,
      path: false,
      os: false
    }
  }
} as NxModuleFederationConfigOverride);

But this is not working.

Can you please point me to right direction?

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