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

BUG - @sap-ux/ui5-proxy-middleware directLoad not working #2225

Closed
1 of 3 tasks
zinserjan opened this issue Aug 6, 2024 · 1 comment
Closed
1 of 3 tasks

BUG - @sap-ux/ui5-proxy-middleware directLoad not working #2225

zinserjan opened this issue Aug 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working ui5-proxy-middleware @sap-ux/ui5-proxy-middleware

Comments

@zinserjan
Copy link

zinserjan commented Aug 6, 2024

Related Feature

Feature request: -

Description

  • directLoad: true does not work and fails with Error: EISDIR: illegal operation on a directory, read

Steps to Reproduce

Steps to reproduce the behavior:

  1. use directLoad: true in @sap-ux/ui5-proxy-middleware
  2. Open /index.html or /test/flpSandbox.html
  3. See error

Expected results

  • no Error
  • URLs are replaced

Actual results

  • Error: EISDIR: illegal operation on a directory, read

Version/Components/Environment

Add any other context about the problem here

OS:

  • Mac OS
  • Windows
  • Other

Node.js v20.16.0

Packages:

  • @ui5/cli v4.0.3
  • @sap-ux/ui5-proxy-middleware v1.4.3

Root Cause Analysis

Problem

  • req.baseUrl is here always an empty string
    const htmlFileName = getHtmlFile(req.baseUrl);
    const yamlFileName = getYamlFile(args);
    const ui5YamlPath = join(projectRoot, yamlFileName);
    const webAppFolder = await getWebAppFolderFromYaml(ui5YamlPath);
    const htmlFilePath = join(projectRoot, webAppFolder, htmlFileName);
    const html = injectUI5Url(htmlFilePath, ui5Configs);
  • htmlFilePath will be just the webapp folder instead of the path to the requested HTML file
  • that's why the further logic doesn't work and instead of replacing the URL in injectUI5Url it tries to read the webapp directory

Fix

  • just use reg.url or reg.originalUrl
@tobiasqueck tobiasqueck added bug Something isn't working ui5-proxy-middleware @sap-ux/ui5-proxy-middleware labels Aug 19, 2024
@tobiasqueck
Copy link
Contributor

@cfg74 could you please plan to get this one fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ui5-proxy-middleware @sap-ux/ui5-proxy-middleware
Projects
None yet
Development

No branches or pull requests

3 participants