Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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 this issue Aug 21, 2024 · 1 comment

Comments

@LukasMetzger
Copy link

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:

  • Not relevant

Smartphone:

  • Not relevant
@petermuessig
Copy link
Member

#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: SAP/cloud-sdk-js#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...

@petermuessig petermuessig changed the title "types" is not exported by "polyfill-node.util.js", imported by "node_modules/node-fetch/src/body.js" [ui5-tooling-modules] "types" is not exported by "polyfill-node.util.js", imported by "node_modules/node-fetch/src/body.js" Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants