diff --git a/src/ts/web-ifc-api.ts b/src/ts/web-ifc-api.ts index 778b3aeb..cd9a4f6d 100644 --- a/src/ts/web-ifc-api.ts +++ b/src/ts/web-ifc-api.ts @@ -29,7 +29,7 @@ let WebIFCWasm: any; let currentScriptPath: string; if (typeof document !== 'undefined') { const currentScriptData = (document.currentScript as HTMLScriptElement); - currentScriptPath = currentScriptData.src.substring(0, currentScriptData.src.lastIndexOf("/") + 1) ; + if (typeof currentScriptData.src !== 'undefined') currentScriptPath = currentScriptData.src.substring(0, currentScriptData.src.lastIndexOf("/") + 1) ; } export * from "./ifc-schema";