-
Notifications
You must be signed in to change notification settings - Fork 73
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
Minification failed with error #890
Comments
Hi @pg-ey, |
Hi @flovogt , thanks for your response. I have a doubt that there is a reference to getOwnPropertySymbols in one of the @ui5/cli dependencies which is causing the issue at the time of minifying. |
Could you share your |
Do you have included https://github.com/es-shims/get-own-property-symbols into your project? |
No, I haven't included this. |
Adding package.json and ui5.yaml here |
|
Also, could you please share the full build log? Ideally after adding the |
Removing the 'ui5' section in the package.json has worked. Thanks @flovogt for the help. |
@VinayCh0wdary Please open a new issue and share your project details with us, so we can have a deeper analysis. |
@VinayCh0wdary I think, I know where the error comes from. It seems that the builder is stupid, but straightforward - it scans all the *.js files in webapp/. If (by any chance) you have a node.js application there with node_modules/ inside, the minifier tries to process all *.js files. And if they don't meet minifier's rules (e.g., there must be no return; in the global scope), it crashes with a useless error. The error handling will be better if it display me the file path and not just a file name. After I debugged it, I found out that you have to exclude node.js resources from the builder folder. I have fixed my error (there was a package has-symbols in /webapp/.../node_modules/...) with the following configuration in ui5.yaml: builder:
resources:
excludes:
- "**/node_modules/**"
- "**/localService/**" |
Thanks a lot @Vest for your input. I can confirm there should be no "node_modules" inside the "webapp" folder. In most scenarios I am aware of having a "node_modules" folder inside the "webapp" folder happens unintended. So, it should be removed. |
…or messsage As suggested by Vest in SAP/ui5-tooling#890 (comment)
…or messsage As suggested by Vest in SAP/ui5-tooling#890 (comment) This should make it easier to identify the resource that is causing an error in the minify task.
…or messsage As suggested by Vest in SAP/ui5-tooling#890 (comment) This should make it easier to identify the resource that is causing an error in the minify task.
@Vest thanks for the suggestion, we'll fix this in one of the next releases via SAP/ui5-builder#1102 👍 |
@flovogt I didn't know this, before I executed @RandomByte thanks for the feature. The more verbose error is, the easier will it be to solve it. |
Expected Behavior
Build successful with minification
Current Behavior
Error Message:
Minification failed with error: 'return' outside of function in file get-own-property-symbols.js (line 11, col 1, pos 255)
Steps to Reproduce the Issue
1.- name: ui5-task-minifier
afterTask: minify
configuration:
html: true
css: true
json: true
Context
ui5 --version
when using the CLI): 3.6.0Log Output / Stack Trace
Error: Minification failed with error: 'return' outside of function in file get-own-property-symbols.js (line 11, col 1, pos 255)
at AsyncFunction.execMinification (file:///home/user/projects/bre-v3/app/node_modules/@ui5/cli/node_modules/@ui5/builder/lib/processors/minifierWorker.js:63:9)
The text was updated successfully, but these errors were encountered: