ui5-community / ui5-ecosystem-showcase

A repository showcasing the UI5 tooling extensibility to combine OSS tools for UI5 application development.
https://ui5-community.github.io/ui5-ecosystem-showcase/
Other
192 stars 93 forks source link

[ui5-tooling-modules] "types" is not exported by "polyfill-node.util.js", imported by "node_modules/node-fetch/src/body.js" #1064

Open LukasMetzger opened 2 months ago

LukasMetzger commented 2 months ago

Description The bug originates from trying to use the @sap-cloud-sdk in a Typescript SAPUI5 Application. After the installation of the module, following this tutorial: Link, I am using ui5-tooling-modules to convert the package to Typescript. Now, when starting the application with ui5 build --clean-dest --config ui5.yaml, I get the depicted error: types" is not exported by "polyfill-node.util.js", imported by "node_modules/node-fetch/src/body.js

Steps to reproduce the behavior:

  1. Install npm install ui5-tooling-modules --save-dev
  2. Add the module to the ui5.yaml, like shown in Exercise 4.1 in the tutorial.
  3. Install npm install --save-dev @sap-cloud-sdk/http-client
  4. Import any part of @sap-cloud-sdk/http-client into a .ts-file. For example: import { executeHttpRequest } from "@sap-cloud-sdk/http-client")
  5. Start the application via ui5 build --clean-dest --config ui5.yaml

Expected behavior The module ui5-tooling-modules-middleware should convert the package using ES modules or commonjs. The application start without errors.

Screenshots 2024-08-21 09_36_06- 2024-08-21 09_36_31-

Desktop:

Smartphone:

petermuessig commented 2 months ago

915 see also in this issue my comment at the end

The biggest issue with the Cloud SDK is that is works somehow in the browser but it seams that it wasn't designed from scratch for that use case and therefore using a generic bundling step is cumbersome. In their docu they describe the webpack configuration to bundle it but I wonder if it still works with Angular / React. Anyways, this looks like a challenge. I'll try to take a look...

For UI5 they got a ticket beginning of last year but they gave up in looking into supporting UI5: https://github.com/SAP/cloud-sdk-js/issues/704 😢

In favor of your topic, I'm closing the old issue because the topic of the cloud-sdk was not the original issue if it...