Skip to content

bug: 4.39 Reference Error with Mixins, Tests and Properties #6503

@kyleMessnerLillyContractor

Description

Prerequisites

Stencil Version

4.39.0

Current Behavior

Unusual reference error when running tests with Mixins that have properties

Image
// the mixin code
import { Event, EventEmitter, MixedInCtor } from '@stencil/core';

export const MyMixin = <B extends MixedInCtor>(Base: B) => {
  class Test extends Base {
    @Event() test!: EventEmitter;

    protected emitTest = (): void => {
      this.test.emit();
    }
  }
  return Test;
};

Expected Behavior

No reference error

System Info

System: node 22.14.0
    Platform: darwin (25.1.0)
   CPU Model: Apple M4 Pro (12 cpus)
    Compiler: /Users/user/Documents/stencil-issue/node_modules/@stencil/core/compiler/stencil.js
       Build: 1765277402
     Stencil: 4.39.0 🎭
  TypeScript: 5.8.3
      Rollup: 4.34.9
      Parse5: 7.2.1
      jQuery: 4.0.0-pre
      Terser: 5.37.0

Steps to Reproduce

npm install
npm test

Code Reproduction URL

https://github.com/kyleMessnerLillyContractor/stencil-issue/tree/issue-1

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within StencilHelp Wanted

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions