Skip to content

bug: Static Initialization Blocks Not Executing with Higher ECMAScript Versions in StencilJS #5360

Closed
@a7medm7med

Description

@a7medm7med

Prerequisites

Stencil Version

4.12.2

Current Behavior

Static initialization blocks fail to execute when the target option in the tsconfig file is set to a higher ECMAScript version than ES2017.

Expected Behavior

Static initialization blocks should execute successfully, regardless of the ECMAScript version specified in the tsconfig file.

System Info

System: node 18.19.0
    Platform: windows (10.0.22631)
   CPU Model: 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz (12 cpus)
    Compiler: D:\Work\Projects\web-components\node_modules\.pnpm\@[email protected]\node_modules\@stencil\core\compiler\stencil.js
       Build: 1707755243
     Stencil: 4.12.2
  TypeScript: 5.3.3
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.27.0

Steps to Reproduce

  • Create a StencilJS project.
  • Configure the tsconfig file to use an ECMAScript version higher than ES2017 in the target option.
  • Implement a class with static initialization blocks.
  • Compile and run the StencilJS project.

Code Reproduction URL

https://github.com/a7medm7med/stencil-static-bug

Additional Information

This issue significantly hinders developers from adopting modern ECMAScript features while working with StencilJS, thus impeding the progression of JavaScript development practices. Any insights, workarounds, or resolutions to address this issue would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions