diff --git a/src/compiler/output-targets/dist-lazy/lazy-output.ts b/src/compiler/output-targets/dist-lazy/lazy-output.ts index 076ddff0aba..1edc5969d8a 100644 --- a/src/compiler/output-targets/dist-lazy/lazy-output.ts +++ b/src/compiler/output-targets/dist-lazy/lazy-output.ts @@ -187,7 +187,7 @@ const getLazyEntry = (isBrowser: boolean): string => { } else { s.append(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';\n`); s.append(`export const defineCustomElements = (win, options) => {\n`); - s.append(` if (typeof window === 'undefined') return Promise.resolve();\n`); + s.append(` if (typeof window === 'undefined') return undefined;\n`); s.append(` globalScripts();\n`); s.append(` return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n`); s.append(`};\n`); diff --git a/src/compiler/output-targets/output-lazy-loader.ts b/src/compiler/output-targets/output-lazy-loader.ts index f30ca3de43d..c3b9933c8c8 100644 --- a/src/compiler/output-targets/output-lazy-loader.ts +++ b/src/compiler/output-targets/output-lazy-loader.ts @@ -85,7 +85,7 @@ export interface CustomElementsDefineOptions { ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void; rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void; } -export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise; +export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void; export declare function applyPolyfills(): Promise; /**