-
Notifications
You must be signed in to change notification settings - Fork 71
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
Since upgrade to @ui5/server@3.2.0 ui5 serve fails with TypeError: Cannot read properties of null #954
Comments
Thank you for reporting @danielang-ortec. We are preparing a fix for this issue. Have you tried downgrading UI5 CLI to the last working version you have mentioned? Even though the package.json specifies a range for |
@RandomByte Thank you.
|
That's good to know, thanks. Sadly npm often shows inconsistent or unexpected behavior with shrinkwraps. Coming back to the issue, I understand the cause of the exception (the What I'm not sure about is the exact cause of this in your project setup. If a manifest.json exists in the custom library, the I confirmed this locally with an application depending on a library that already contains a manifest.json. No error occurs and the
If possible, a stripped down sample of the problematic library would be great to analyze this further. I hope you understand that I find it important to understand the root cause before implementing a fix. |
Our library exposes itself as type Thus the following configuration is used: specVersion: '3.2'
metadata:
name: "com.my.lib"
type: module
resources:
configuration:
paths:
/resources/com/my/lib/: ./dist/resources/com/my/lib/
/thirdparty/com/my/lib/: ./dist/resources/com/my/lib/ When debugging the versionInfo middleware it seams like you are trying to resolve the path of the manifest by namespace which isn't working: @1: I tried it, but it was logged so much that the relevant lines were quickly exceeding the lines buffer of my console. I could try to log into a file if it is really required. @2: Returns the error:
With my modification from above the content is delivered correctly. It also resolves the version of my library but not the {
"name": "com.my.app",
"version": "1.1.2",
"buildTimestamp": "202405142117",
"scmRevision": "",
"libraries": [
{
"name": "com.my.lib",
"version": "1.1.1",
"buildTimestamp": "202405142117",
"scmRevision": ""
},
{
"name": "sap.chart",
"version": "1.120.13",
"buildTimestamp": "202405142117",
"scmRevision": "",
"manifestHints": {
"dependencies": {
"libs": {
"sap.m": {
"lazy": true
},
"sap.ui.core": {},
"sap.ui.layout": {
"lazy": true
},
"sap.ui.unified": {
"lazy": true
},
"sap.viz": {}
}
}
}
},
...
]
} @3: Yes, but all from SAP or the community: server:
customMiddleware:
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
backend:
- path: /sap
url: https://host.intranet:8443
- name: fiori-tools-appreload
afterMiddleware: compression
configuration:
port: 35729
path: webapp
delay: 300
- name: fiori-tools-preview
afterMiddleware: fiori-tools-appreload
configuration:
component: com.my.app
ui5Theme: sap_horizon
- name: ui5-tooling-transpile-middleware
afterMiddleware: compression
configuration:
debug: true
transpileAsync: true
transpileTypeScript: true
excludePatterns:
- /Component-preload.js
- name: ui5-tooling-modules-middleware
afterMiddleware: ui5-tooling-transpile-middleware
configuration: &modulesConfig
addToNamespace: true |
…ary' Ignore any other project types, even if the project contains a .library file. Some projects might consume UI5 libraries configured as type "module". In order to align the ui5-server's behavior with the ui5-builder, those projects must be ignored when generating the sap-ui-version.json. For the same reason the serveResources middleware must not attempt to generate a missing manifest.json for such projects. Resolves SAP/ui5-tooling#954
…ary' Ignore any other project types, even if the project contains a .library file. Some projects might consume UI5 libraries configured as type "module". In order to align the ui5-server's behavior with the ui5-builder, those projects must be ignored when generating the sap-ui-version.json. For the same reason the serveResources middleware must not attempt to generate a missing manifest.json for such projects. Resolves SAP/ui5-tooling#954
Thanks. This was the missing piece of information for me 👍 Projects of type I've prepared a fix that should resolve this regression for you. |
…ary' Ignore any other project types, even if the project contains a .library file. Some projects might consume UI5 libraries configured as type "module". In order to align the ui5-server's behavior with the ui5-builder, those projects must be ignored when generating the sap-ui-version.json. For the same reason the serveResources middleware must not attempt to generate a missing manifest.json for such projects. Resolves SAP/ui5-tooling#954
The fix was released with |
Confirmation: It is working. |
Expected Behavior
ui5 serve
should deliver all manifest.json files regardless if it generates them on the fly or serves an existing one.Current Behavior
In our project we developed our own typescript control library. The library is build by the ui5-tooling. During build time a
manifest.json
is generated by the taskgenerateLibraryManifest
. The library is published to our internal npm registry.This library is added to our project.
With the last version 3.9.2
ui5 serve
worked perfectly. With the update to 3.10.x the new @ui5/server version 3.2.0 was pulled, which contains the following error:TypeError: Cannot read properties of null (reading 'setProject')
(Stack Trace attached)It is in the file
node_modules\@ui5\cli\node_modules\@ui5\server\lib\middleware\helper\generateLibraryManifest.js
wherecreateManifestProcessor
is called. This method resolves tonull
if it detects that a manifest.json already exists.On this returned value
setProject(project)
will be called. This results in the mentioned TypeError since this value could benull
.Temporary Solution: When modifiying the function call to
res?.setProject(project);
the error does not occure anymore and my app loads again.Sidenote: You should maybe consider to pin the dependecies of @ui5/cli; downgrading to the previously working 3.9.2 version is not working because
"@ui5/server": "^3.1.5"
now resolves to 3.2.0 due to the ^. I would expect at least ~ or a direct version. Thank you for considering.Steps to Reproduce the Issue
Context
ui5 --version
when using the CLI):3.10.1
v20.11.0
9.3.0
Windows 10 x64
unknown
nothing
Log Output / Stack Trace
The text was updated successfully, but these errors were encountered: