Wrap sprig init in check for window
This commit is contained in:
parent
91da39370f
commit
4162cca3ff
|
@ -5,7 +5,7 @@
|
|||
import { ENV_CONFIG } from 'common/envs/constants'
|
||||
import { PROD_CONFIG } from 'common/envs/prod'
|
||||
|
||||
if (ENV_CONFIG.domain === PROD_CONFIG.domain) {
|
||||
if (ENV_CONFIG.domain === PROD_CONFIG.domain && typeof window !== 'undefined') {
|
||||
try {
|
||||
;(function (l, e, a, p) {
|
||||
if (window.Sprig) return
|
||||
|
@ -20,6 +20,7 @@ if (ENV_CONFIG.domain === PROD_CONFIG.domain) {
|
|||
a.async = 1
|
||||
a.src = e + '?id=' + S.appId
|
||||
p = l.getElementsByTagName('script')[0]
|
||||
ENV_CONFIG.domain === PROD_CONFIG.domain &&
|
||||
p.parentNode.insertBefore(a, p)
|
||||
})(document, 'https://cdn.sprig.com/shim.js', ENV_CONFIG.sprigEnvironmentId)
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user