-
Notifications
You must be signed in to change notification settings - Fork 7
"Cannot read properties of undefined (reading 'map')" when running ui5lint #583
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
Comments
Hey @Lemonron! Thank you for reporting this issue. Could you please enable the Thanks 👍🏻 |
I redacted some things, I hope it's still readeable. 11:08 $ npm install --global @ui5/linter
removed 1 package, and changed 336 packages in 7s
69 packages are looking for funding
run `npm fund` for details
✔ ~/repos/redacted [main|✔]
11:18 $ ui5lint --verbose
verb cli:middlewares:base using ui5lint version 1.11.0 (from /opt/homebrew/lib/node_modules/@ui5/linter/bin/ui5lint.js)
verb cli:middlewares:base using node version v22.14.0
verb generateProjectGraph Creating project graph using object...
verb graph:Module Could not find any build manifest in module ui5-linter-target
verb graph:Module Configuration for module ui5-linter-target is provided in YAML file at /Users/redacted/repos/redacted/ui5.yaml
verb specifications:types:Application Path mapping for application project com.redacted:
verb specifications:types:Application Physical root path: /Users/redacted/repos/redacted
verb specifications:types:Application Mapped to: webapp
verb specifications:types:Application Namespace of project com.redacted is com/redacted(from manifest.json)
verb graph:Module Module ui5-linter-target contains project com.redacted
verb graph:projectGraphBuilder Root project com.redacted qualified as application project for project graph
verb graph:ProjectGraph Adding project: com.redacted
verb graph:ProjectGraph Skipping resolution of optional dependencies since none have been declared
perf Trace Project Graph creation took 273.82 ms
perf Trace Linting manifest.json files took 14.97 ms
perf Trace ts.createProgram took 2.15 s ⚠ (slow)
perf Trace program.getTypeChecker took 0.00 ms
⚠️ Process Failed With Error
Error Message:
Cannot read properties of undefined (reading 'map')
Stack Trace:
TypeError: Cannot read properties of undefined (reading 'map')
at new TraceMap (file:///opt/homebrew/lib/node_modules/@ui5/linter/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs:319:40)
at new SourceFileReporter (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/linter/ui5Types/SourceFileReporter.js:26:34)
at new SourceFileLinter (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/linter/ui5Types/SourceFileLinter.js:69:26)
at TypeChecker.lint (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/linter/ui5Types/TypeLinter.js:119:32)
at async lintWorkspace (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/linter/lintWorkspace.js:49:5)
at async lint (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/linter/linter.js:143:17)
at async lintProject (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/linter/linter.js:55:17)
at async UI5LinterEngine.lint (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/index.js:16:20)
at async Object.handleLint [as handler] (file:///opt/homebrew/lib/node_modules/@ui5/linter/lib/cli/base.js:121:17)
If you think this is an issue of the ui5-linter, you might report it using the following URL: https://github.com/SAP/ui5-linter/issues/new/choose |
Ah, I'm sorry, in that case the corresponding file is not included as it fails before it would be logged. You have to enable The important detail is the file that is linted, which should be logged right before the "Process Failed With Error" message like this: If you could provide that file, and if required, provide a redacted version with which the issue still appears, that would be really helpful for us 👍🏻 |
Oops, it's a file in the "dist" folder. I assume this should not be linted? silly linter:ui5Types:TypeLinter Linting /resources/com/redacted/dist/Component-preload.js Everything works smoothly when ignoring the "dist" folder: 12:46 $ ui5lint --ignore-pattern "webapp/dist/**"
UI5 linter report:
0 problems (0 errors, 0 warnings) Do you still want the file? |
Ah, okay. Yes, if you put the "dist" folder into "webapp" for whatever reason, you should ignore that folder from linting (e.g. via ui5lint.config). In general, we don't recommend to mix build results with the sources as it may have other implications. No need to share the file, this can be reproduced with any |
Reopening this issue, as we want to prevent the error from appearing and will maybe log a warning when bundles are linted to still tell the user that something isn't right. |
This fixes an exception that was happening when a source map with sections was being processed. It mainly occurred when a UI5 bundle such as a `Component-preload.js` is part of the project sources and not excluded from linting. UI5 bundles are now excluded from linting and AMD transpilation. In addition, source maps with sections are not processed. Fixes: #583
Expected Behavior
ui5lint running successfully
Current Behavior
Steps to Reproduce the Issue
See current behavior
Context
1.11.0
22.14.0
(also occurs in23.9.0
)10.9.2
macOS Sequoia 15.3.1
Log Output / Stack Trace
See current behavior
The text was updated successfully, but these errors were encountered: