fix: try/catch external scripts to avoid them breaking our page #sw-2763 * fix: try/catch external scripts to avoid them breaking our page #sw-2763 Approved-by: Joakim Jäderberg
19 lines
438 B
TypeScript
19 lines
438 B
TypeScript
import * as Sentry from "@sentry/nextjs"
|
|
import Script from "next/script"
|
|
|
|
import { env } from "@/env/server"
|
|
|
|
export default function AdobeSDKScript() {
|
|
return env.ADOBE_SDK_SCRIPT_SRC ? (
|
|
<Script
|
|
data-cookieconsent="statistics"
|
|
src={env.ADOBE_SDK_SCRIPT_SRC}
|
|
async
|
|
onError={(e) => {
|
|
console.error("Failed to load AdobeSDK script", e)
|
|
Sentry.captureException(e)
|
|
}}
|
|
/>
|
|
) : null
|
|
}
|