Skip to content

bug?: maximum call stack size exceeded in test after stencil upgrade 4.31.0 -> 4.35.1 #6307

@Cliffback

Description

@Cliffback

After updating from 4.31.0 to 4.35.1 suddenly some of our tests fail with RangeError: Maximum call stack size exceeded

Image

We got three tests failing with this, but in all instances I can just remove the the last await page.waitForChanges() and the test succeeds:

Image

So, not a huge issue or anything, I'm just curious what could have caused it to suddenly start failing. I have confirmed that this only happens with 4.35.1, as upgrading to any other version after 4.31.0 works fine without taking any action

Most likely related to this PR: #6301

Not a huge issue for us, as the component still works fine, it is just the tests that is failing, and there is an easy fix by just removing the waitForChanges(), just thought I should make you aware of it.

Repo that reproduces the failing tests: stencil-bug-reproduction

Full error:

    RangeError: Maximum call stack size exceeded

      330 |
      331 |   private unfocusInput() {
    > 332 |     const inputElement = this.el.shadowRoot?.querySelector<HTMLInputElement>('#dropdown-input');
          |                                              ^
      333 |     if (inputElement) inputElement.blur();
      334 |     this.searchQuery = '';
      335 |     this.searchEmitter.emit('');

      at selectOne (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6167:5)
      at _MockDocumentFragment.querySelector (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:7133:12)
      at StnDropdown.querySelector [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:332:46)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      at HostElement.<anonymous> (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/internal/testing/index.js:4236:72)
      at ../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:776:26
          at Array.forEach (<anonymous>)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:774:15)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at triggerEventListener (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:791:5)
      at dispatchEvent (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:808:3)
      at MockInputElement.blur (../../node_modules/.pnpm/@stencil+core@4.35.1/node_modules/@stencil/core/mock-doc/index.cjs:6836:5)
      at StnDropdown.blur [as unfocusInput] (src/components/stn-dropdown/stn-dropdown.tsx:333:36)
      at StnDropdown.unfocusInput (src/components/stn-dropdown/stn-dropdown.tsx:165:10)
      System: node 22.14.0
    Platform: linux (6.6.87.2-microsoft-standard-WSL2)
   CPU Model: 12th Gen Intel(R) Core(TM) i7-12800HX (24 cpus)
    Compiler: /home/mathiaseek/dev/stencil-bug-reproduction/node_modules/@stencil/core/compiler/stencil.js
       Build: 1750123236
     Stencil: 4.35.1 🦄
  TypeScript: 5.5.4
      Rollup: 4.34.9
      Parse5: 7.2.1
      jQuery: 4.0.0-pre
      Terser: 5.37.0

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions