-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix: create image using document method to avoid ReferenceError in SSR #6569
Conversation
This preview will be available after the AzureCI is passed. |
Codecov Report
@@ Coverage Diff @@
## master #6569 +/- ##
==========================================
+ Coverage 89.88% 89.92% +0.03%
==========================================
Files 481 481
Lines 15374 15381 +7
Branches 2343 2344 +1
==========================================
+ Hits 13819 13831 +12
+ Misses 937 929 -8
- Partials 618 621 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, there is some test failed, the detailed is below
https://dev.azure.com/ng-zorro/NG-ZORRO/_build/results?buildId=3439&view=logs&jobId=279bf605-51e8-5634-b9b8-b38240bbf17e&j=279bf605-51e8-5634-b9b8-b38240bbf17e&t=f720c3be-c865-5389-3eca-d1d8af810617
@hsuanxyz Can you help me with the unit test? |
@duong-le I have not found an alternative to the current change, until #1836 · jasmine/jasmine is processed. so I suggest skipping the |
@hsuanxyz I skipped the |
@duong-le try this. private previewImage(file: File | Blob): Promise<string> {
+ if (!this.platform.isBrowser) {
+ return Promise.resolve('');
+ }
return new Promise(resolve => {
...
this.ngZone.runOutsideAngular(() => {
...
+ const img = new Image();
- const img = this.doc.createElement('img');
...
});
...
});
}
|
@hsuanxyz All test cases are now passed, please review once again. Thank you very much. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@hsuanxyz please release this fix as a minor version. I really need this fix in my app in production. |
@duong-le /~https://github.com/NG-ZORRO/ng-zorro-antd-builds/releases/tag/11.4.0%2Bd7b9291dfd
"dependencies": {
+ "ng-zorro-antd": "github:NG-ZORRO/ng-zorro-antd-builds#011764a7b2187fcf9eb05a22a44cf11e7f41b62d"
} |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #6559
What is the new behavior?
Does this PR introduce a breaking change?
Other information