Skip to content
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(kit): File throws SSR error ReferenceError: File is not defined #7085

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

nsbarsukov
Copy link
Member

@nsbarsukov nsbarsukov commented Mar 25, 2024

Run nx serve-ssr and open /components/input-files.
Node.js throws:

ReferenceError: File is not defined
    at createPreview (webpack:///projects/kit/components/files/file/file.component.ts:150:29)
    at patched (webpack:///projects/cdk/decorators/pure.ts:141:38)
    at preview (webpack:///projects/kit/components/files/file/file.component.ts:81:34)
    at templateFn (webpack:///projects/kit/components/files/file/file.template.html:47:10)
    at executeTemplate (webpack:///node_modules/@angular/core/fesm2022/core.mjs:12003:13)
    at refreshView (webpack:///node_modules/@angular/core/fesm2022/core.mjs:13498:13)
    at detectChangesInView (webpack:///node_modules/@angular/core/fesm2022/core.mjs:13663:9)
    at detectChangesInEmbeddedViews (webpack:///node_modules/@angular/core/fesm2022/core.mjs:13606:13)
    at refreshView (webpack:///node_modules/@angular/core/fesm2022/core.mjs:13522:9)
    at detectChangesInView (webpack:///node_modules/@angular/core/fesm2022/core.mjs:13663:9)

if (file instanceof File && file.type && file.type.startsWith('image/')) {

Relates to #2332

Copy link

lumberjack-bot bot commented Mar 25, 2024

Pull request was closed ✔️

All saved screenshots (for current PR) were deleted 🗑️

Copy link
Contributor

github-actions bot commented Mar 25, 2024

Visit the preview URL for this PR (updated for commit 2f1df01):

https://taiga-ui--pr7085-file-ssr-error-dxog59wk.web.app

(expires Wed, 27 Mar 2024 08:05:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4b5ece1e114386f6a105425ef799091475b249eb

Copy link

bundlemon bot commented Mar 25, 2024

BundleMon

Files updated (1)
Status Path Size Limits
demo/browser/main.(hash).js
313.31KB (+68B +0.02%) +10%
Unchanged files (4)
Status Path Size Limits
demo/browser/vendor.(hash).js
204.17KB +10%
demo/browser/runtime.(hash).js
38.63KB +10%
demo/browser/styles.(hash).css
13.85KB +10%
demo/browser/polyfills.(hash).js
11.21KB +10%

Total files change +73B +0.01%

Groups updated (1)
Status Path Size Limits
demo/browser/*..js
2.45MB (-225B -0.01%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@splincode splincode merged commit c6b6688 into main Mar 26, 2024
25 of 26 checks passed
@splincode splincode deleted the file-ssr-error branch March 26, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants