We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23b963b commit 77d52d6Copy full SHA for 77d52d6
src/helpers/get-zaraz.ts
@@ -3,7 +3,7 @@
3
* an error. Else returns the zaraz object.
4
*/
5
export function getZaraz() {
6
- if (!window?.zaraz) {
+ if (typeof window !== 'undefined' && !window?.zaraz) {
7
throw new Error(
8
`Cannot use Zaraz Web API, because window.zaraz is not defined.`,
9
);
0 commit comments