Skip to content

bug: defineCustomElements return type is wrong #4589

Closed

Description

@andrew9994

Prerequisites

Stencil Version

4.0.1

Current Behavior

Currently the return type of defineCustomElements is defined as a Promise<void> on this line in the output-lazy-loader,
but the promise got removed in this commit.

Expected Behavior

The return value of defineCustomElements should be typed correctly. However, I am not sure whether this change should be marked as a breaking change.

System Info

No response

Steps to Reproduce

Import defineCustomElements from the loader of a package and try to do something after the promise gets resolved.

import { defineCustomElements } from 'stencil-package/loader';

defineCustomElements().then(() => {
  console.log('elements defined');
})

Code Reproduction URL

n/a

Additional Information

No response

Activity

  1. alicewriteswrongs commented on Jul 18, 2023

    @alicewriteswrongs
    Contributor

    @andrew9994 thanks for reporting, I was just able to confirm that this is an issue by putting together a quick reproduction here (https://github.com/alicewriteswrongs/stencil-custom-elements-repro)

    In the future when reporting issues if you have time to put together something along those lines it greatly helps us in diagnosing problems!

    The fix is straightforward here so I'm going to get going on it. Thanks again for filing this!

  2. added
    Bug: Validated
    on Jul 18, 2023
  3. andrew9994 commented on Jul 21, 2023

    @andrew9994
    ContributorAuthor

    Thanks @alicewriteswrongs for jumping on this so quickly 😊 and sorry for not creating a repro repo, will do it next time.

  4. rwaskiewicz commented on Jul 24, 2023

    @rwaskiewicz
    Member

    The fix for this issue has been released as a part of today's Stencil v4.0.2 release. As a result, I'm going to close this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Bug: Validated

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions