-
Notifications
You must be signed in to change notification settings - Fork 52
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
Window is not defined issue after updating to angular v16 #102
Comments
Hii @ahmadallw, I don't think this library has anything to do with the issue, I too had the same problem when I updated to angular 16 but for a different library, The library was dependent on window object to work, it was working till angular 15, after reverting back to v15 the issue got resolved. My guess is angular team has changed something that we are unaware of. For your reference, this was the library |
Hey version 14.0.1 introduces this behavior. The reason is, that until 14.0.0, masony-layout is only loaded, if the platform is the browser ac0fba0#diff-aefcd863ab41105b9cb15444561732d61ca30a75efadda97f6aad513ad01e6f0L39 In 14.0.1 it is imported without this check. Since https://github.com/desandro/masonry/blob/master/masonry.js (line 9) is using window without checking if it is valid, the error is thrown for SSR |
Same issue |
Same issue here. Related old issue: #37
Should this library import masonry-layout only when a browser environment is detected ? Is this doable with the Edit: also related with possible workaround: desandro/masonry#1121 (comment) |
After updating project to angular 16 & when running npm run build:dev & npm run build:dev:ssr the following error appears
Window is not defined
We tried to remove ngx-masonry & run build the issue disappears & build works normally
I guess ngx-masonry should be update to be compatible with angular 16
can we have any support or help to fix this issue
The text was updated successfully, but these errors were encountered: