Prerequisites
Stencil Version
4.44.0
Current Behavior
My setup:
Consuming a stencil lib in a React App like:
defineCustomElements().then(() => setAssetPath(
`${window.location.protocol}//assets.${window.location.host}/`
));
But getting a TS error:
TS2339: Property then does not exist on type void
Expected Behavior
No TS error.
System Info
System: node 22.19.0
Platform: darwin (25.5.0)
CPU Model: Apple M1 Max (10 cpus)
Compiler: /.......node_modules/@stencil/core/compiler/stencil.js
Build: 1779994050
Stencil: 4.43.5 🍐
TypeScript: 5.8.3
Rollup: 4.44.0
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0
Steps to Reproduce
Just add .then() to defineCustomElements() in your consuming project.
Code Reproduction URL
no
Additional Information
/esm/loader.js defining as async which returns Promise:
const defineCustomElements = async (win, options) =>
but
/loader/index.d.ts defining as void:
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
Prerequisites
Stencil Version
4.44.0
Current Behavior
My setup:
Consuming a stencil lib in a React App like:
But getting a TS error:
TS2339: Property then does not exist on type voidExpected Behavior
No TS error.
System Info
System: node 22.19.0 Platform: darwin (25.5.0) CPU Model: Apple M1 Max (10 cpus) Compiler: /.......node_modules/@stencil/core/compiler/stencil.js Build: 1779994050 Stencil: 4.43.5 🍐 TypeScript: 5.8.3 Rollup: 4.44.0 Parse5: 7.2.1 jQuery: 4.0.0-pre Terser: 5.37.0Steps to Reproduce
Just add
.then()todefineCustomElements()in your consuming project.Code Reproduction URL
no
Additional Information
/esm/loader.jsdefining as async which returns Promise:const defineCustomElements = async (win, options) =>but
/loader/index.d.tsdefining as void:export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;