Repository navigation
Commit cb372fc
fix: guard document/window access in I18n to prevent Node.js crash
getCookie() accesses document.cookie and getUrlParameter() accesses
window.location via ranuts utilities. When Playwright imports
@bybrowser/editor in Node.js (for onlyoffice-new-document.spec.ts),
the module-level `new I18n()` call crashes with
'ReferenceError: document is not defined'. Add typeof guards so both
methods return null safely in SSR/Node.js environments.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 58e2ee4 commit cb372fc
2 files changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
0 commit comments