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-middleware-ui5] Not working with server option --h2 #916

Closed
dscFaow opened this issue Nov 13, 2023 · 8 comments
Closed

[ui5-middleware-ui5] Not working with server option --h2 #916

dscFaow opened this issue Nov 13, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@dscFaow
Copy link

dscFaow commented Nov 13, 2023

Describe the bug
If you add the parameter --h2 to the server, the path is not mounted.

[email protected] start
ui5 serve

info graph:projectGraphBuilder Excluding additional application project my.test.tsapp from graph. The project graph can only feature a single project of type application. Project my.test.app has already qualified for that role.
info graph:helpers:ui5Framework Using OpenUI5 version: 1.118.0
info server:custom-middleware:ui5-middleware-livereload Livereload server started!
info server:custom-middleware:ui5-middleware-ui5 Mounting /resources/my/test/tsapp to UI5 app XXX\showcase-ui5-middleware-ui5-main\packages\my.test.tsapp (id=my.test.tsapp)
Server started
URL: http://localhost:8080
info graph:helpers:ui5Framework Using OpenUI5 version: 1.118.0
info server:custom-middleware:ui5-middleware-livereload Livereload server started!
> [email protected] start
> ui5 serve --h2

info graph:projectGraphBuilder Excluding additional application project my.test.tsapp from graph. The project graph can only feature a single project of type application. Project my.test.app has already qualified for that role.
info graph:helpers:ui5Framework Using OpenUI5 version: 1.118.0
info server:custom-middleware:ui5-middleware-livereload Livereload server started!
(node:32052) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Server started
URL: https://localhost:8443

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/petermuessig/showcase-ui5-middleware-ui5
  2. Add parameter --h2 to the start script
  3. See error
@petermuessig
Copy link
Member

Thx @faow for the issue, I'll take a look once I have a bit of free time...

@petermuessig petermuessig self-assigned this Nov 13, 2023
@petermuessig
Copy link
Member

@faow - short update - the problem is the way how we hook into the express application and in case of https is being used, the original express app is wrapped into a spdy app for which the listen call isn't overridden. I'm not sure yet whether this can work at all, as there is no real possibility to intercept the spdy listen call from outside... 😢

@dscFaow
Copy link
Author

dscFaow commented Nov 14, 2023

@petermuessig
Thanks for letting me know.
Since https is not a fixed requirement for us, I will switch to http for the time being and hope that someone might have an idea in the future.

@petermuessig
Copy link
Member

@faow - ok, good to know - I'm still looking into the topic - currently searching for the best possible way to retrieve the necessary information when the UI5 tooling is putting spdy around the express server. To be able to hook into the express application I need to get access to the app and the server and I now need to revalidate how this could be achieved with spdy. It's a bit tricky and I require some more think time for that...

@petermuessig
Copy link
Member

There seems to be no possibility to overcome that issue. The following lines in the UI5 tooling override the express app with the spdy app and thus the listen callback isn't invoked anymore:

https://github.com/SAP/ui5-server/blob/main/lib/server.js#L180-L182

IMO, the only way to support this development middleware also for https is that the UI5 tooling exposes the server. I need to follow up on this with @RandomByte and @matz3

@petermuessig petermuessig added the enhancement New feature or request label May 27, 2024
@petermuessig
Copy link
Member

@RandomByte @matz3 - is it possible to provide access to the server with the next major upgrade of the UI5 tooling for the h2 case?

@RandomByte
Copy link
Member

We hope to implement the "component type" in UI5 Tooling sometime soon which should hopefully make this middleware obsolete: SAP/ui5-tooling#45

In general, we would like to provide specific APIs for custom middleware to achieve what they want. By exposing the underlying server instance we loose control over which middleware is handling which request and can't guarantee compatibility anymore. So let's rather try and discuss whether we can solve such use cases through specific API provided by ui5-server 👍

@petermuessig petermuessig added the wontfix This will not be worked on label Jul 25, 2024
@petermuessig
Copy link
Member

Closing, as @RandomByte suggest a better solution for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants