-
Notifications
You must be signed in to change notification settings - Fork 72
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
Build failed after estraverse
upgraded to 4.3.0
#394
Comments
The error is thrown by some self-protecting check of the JSModuleAnalyzer. When the set of node types in an ASTree is extended (as it was the case now for dynamic imports) and when the analyzer doesn't know the semantics of the new node type, it could take wrong decisions. To avoid this, it compares its set of know types wit the set of types exposed by estraverse and throws in case of a mismatch. We just have to think how to better integrate this in our delivery. An update of estraverse now immediately makes all new installations of the tooling fail, which is quite bad and was not the intention of the check. On the other side, the incident shows that the test makes sense. We won't become aware of extensions beforehand. Maybe we can limit the failure to cases where the new node type really occurs in the analyzed AST or we accept some (suboptimal) default behavior for new nodes (e.g. all code branches are assumed to be unconditional, might result in too many eager dependencies). I just winder how to get feedback then. |
Mhmm, after naively applying a fix, I see from the travis build failures that our package-lock.json should have prevented this issue. @zhangliangyi Can you elaborate on how you install the ui5 tooling? |
@codeworrior |
|
No. Projects should fix their dependencies using lockfiles. By default, npm always generates a Yarn automatically generates a The usage of lockfiles prevent issues like the one reported here from occurring in existing projects where no changes to the package.json have been made. |
UI5 Builder release v1.4.1 is now compatible with |
Thanks for the insight into the purpose of For background, SuccessFactors has hundreds of repositories/applications each having several package.json files, and most of these have references to internal SuccessFactors dependencies that look similar to the following:
The usage of Can you help to clarify if I missed something or give more background on this? I think we might want to reconsider our approach to solving this problem of ours, and maybe we should use package-lock.json files, but instead maybe think of some other gradle code that could re-write the package.json file directly for things like:
What do you think? |
Since the "self-protection" mechanism of JSModuleAnalyzer [1] is highly dependent on the set of possible node types provided by estraverse, we often saw problems in consuming projects after new releases of estraverse. We typically only notice these after the automatic dependency update every Sunday. Our unit tests detect these issues. This change forces consumers to use a version of estraverse that is supported by JSModuleAnalyzer. Version updates will only happen through pull requests created by dependabot. [1]: https://github.com/SAP/ui5-builder/issues/309#issuecomment-521108883
Since the "self-protection" mechanism of our JSModuleAnalyzer [1] is highly dependent on the set of possible node types provided by estraverse, we often saw problems in consuming projects after new releases of estraverse. With estraverse@5.2.0 this is yet again the case. This change forces consumers to use a version of estraverse that is supported by JSModuleAnalyzer (currently 5.1.0). Version updates will only happen through pull requests created by dependabot. [1]: https://github.com/SAP/ui5-builder/issues/309#issuecomment-521108883
Since the "self-protection" mechanism of our JSModuleAnalyzer [1] is highly dependent on the set of possible node types provided by estraverse, we often saw problems in consuming projects after new releases of estraverse. With estraverse@5.2.0 this is yet again the case. This change forces consumers to use a version of estraverse that is supported by JSModuleAnalyzer (currently 5.1.0). Version updates will only happen through pull requests created by dependabot. [1]: https://github.com/SAP/ui5-builder/issues/309#issuecomment-521108883
Expected Behavior
The ui5 build works.
Current Behavior
The ui5 build is failed.
Steps to reproduce the issue
Context
ui5 --version
when using the CLI):{...}
8.12.0
5.6.0
SUSE Linux
N/A
N/A
Affected components (if known)
Log Output / Stack Trace
Hi colleague,
I am from the SAP Sucessfactors, and we are using the ui5 builder in our daily build. Today we found an issue in ui5-builder and all the UI builds are failed.
Per my investigation, there is a new release of
estraverse
in several hours ago, it imported a new property called 'ImportExpression'. And I find in theJSModuleAnalyzer.js
in ui5-builder, it will check all the properties exposed byestraverse
.estools/estraverse@7fc4475#diff-16e183a8233505f249340c48ca541fd2
Since the
ImportExpression
is not defined in theJSModuleAnalyzer.js
, an error would be thrown and the build is failed.The text was updated successfully, but these errors were encountered: