open-ux-tools
open-ux-tools copied to clipboard
BUG - @sap-ux/ui5-proxy-middleware directLoad not working
Related Feature
Feature request: -
Description
directLoad: truedoes not work and fails with Error:EISDIR: illegal operation on a directory, read
Steps to Reproduce
Steps to reproduce the behavior:
- use
directLoad: truein @sap-ux/ui5-proxy-middleware - Open /index.html or /test/flpSandbox.html
- 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
- [x] 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.baseUrlis here always an empty string https://github.com/SAP/open-ux-tools/blob/c0f92980c658ad2fc9f28de75b3e778d5fa36559/packages/ui5-proxy-middleware/src/base/utils.ts#L275-L280htmlFilePathwill 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
injectUI5Urlit tries to read the webapp directory
Fix
- just use
reg.urlorreg.originalUrl
@cfg74 could you please plan to get this one fixed.