-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
bug(datepicker/mat-calendar): ERROR ReferenceError: window is not defined #26729
Labels
area: material/datepicker
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Mar 7, 2023
Fixes that the datepicker was referring to the `window` which throws an error during server-side rendering. Fixes angular#26729.
crisbeto
added a commit
that referenced
this issue
Mar 8, 2023
crisbeto
added a commit
that referenced
this issue
Mar 8, 2023
Fixes that the datepicker was referring to the `window` which throws an error during server-side rendering. Fixes #26729.
@crisbeto Which version of material will this fix apply to? |
It should be in 15.2.2. |
Ok thanks
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: material/datepicker
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
13.x
Description
I use the date picker in calendar mode in the sidebar on the main page. the component is initialized when the application is loaded.
After upgrading from version 13.x to 14.x and after to 15.x I get an error in the console. But the application starts up and the calendar works
Reproduction
Steps to reproduce:
Expected Behavior
no error
Actual Behavior
ERROR ReferenceError: window is not defined
at apply (./node_modules/@angular/material/fesm2020/datepicker.mjs:289:13)
at invoke (./node_modules/zone.js/dist/zone-node.js:400:30)
at run (./node_modules/zone.js/dist/zone-node.js:160:47)
at runOutsideAngular (./node_modules/@angular/core/fesm2020/core.mjs:24137:28)
at constructor (./node_modules/@angular/material/fesm2020/datepicker.mjs:280:17)
at factory (./node_modules/@angular/material/fesm2020/datepicker.mjs:492:21)
at getNodeInjectable (./node_modules/@angular/core/fesm2020/core.mjs:3484:44)
at instantiateAllDirectives (./node_modules/@angular/core/fesm2020/core.mjs:11038:27)
at createDirectivesInstances (./node_modules/@angular/core/fesm2020/core.mjs:10511:5)
at Module.ɵɵelementStart (./node_modules/@angular/core/fesm2020/core.mjs:13641:9)
Environment
The text was updated successfully, but these errors were encountered: