Skip to content

Impossible to use this framework on browser without polyfilling node #84

@climam

Description

@climam

Hello,

I am trying to use the aem-headless-client-js in a Angular 18 application. Since Angular 12, the default webpack config of Angular no longer polyfills the node API by default.
We are currently unable to use the framework as we are having a runtime issue: "ReferenceError: process is not defined."

When looking at the error stack, the issue comes from the aio-lib-core-errors, which seems to be developed to work under a node runtime... it is doing a require('util') which does not work in a browser.

Suggestions to make it easier to install on browser js/ts apps:

  • Make sure all the dependencies are usable in a browser.
  • Deliver a build of your framework including the required polyfills.

In any scenario, it would be great to also include the TypeScript types of your framework for easier adoption in TypeScript apps like Angular.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions