Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐞] server$ doesn't work in unit test when binding to an event handler of DOM element #4034

Closed
ahnpnl opened this issue May 3, 2023 · 1 comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@ahnpnl
Copy link
Contributor

ahnpnl commented May 3, 2023

Which component is affected?

Qwik Runtime

Describe the bug

When using server$ for a DOM event handler, for example click event handler, server$ throws error

➤ YN0000: QWIK ERROR ReferenceError: SubmitEvent is not defined
➤ YN0000:     at /node_modules/@builder.io/qwik-city/index.qwik.mjs:759:30
➤ YN0000:     at Array.map (<anonymous>)
➤ YN0000:     at serverQrl_stuff_wOIPfiQ04l4 (/node_modules/@builder.io/qwik-city/index.qwik.mjs:758:31)
➤ YN0000:     at invoke (/builds/dist-dev/tsc-out/packages/qwik/src/core/use/use-core.js:60:6)
➤ YN0000:     at /builds/dist-dev/tsc-out/packages/qwik/src/core/qrl/qrl-class.js:63:18
➤ YN0000:     at invokeQRL (/builds/dist-dev/tsc-out/packages/qwik/src/core/qrl/qrl-class.js:82:23)
➤ YN0000:     at async Promise.all (index 0)

The bug occurs with Qwik version >=0.104.0

Reproduction

https://github.com/ahnpnl/my-qwik-app/tree/bug/server-function

Steps to reproduce

  • Check out the repo URL, branch bug/server-function
  • Install deps with pnpm
  • Run pnpm run test.unit
  • Observe the error

System Info

System:
    OS: macOS 13.3.1
    CPU: (8) arm64 Apple M1
    Memory: 108.77 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.5 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 112.0.5615.137
    Firefox: 111.0.1
    Safari: 16.4
  npmPackages:
    @builder.io/qwik: 1.0.0 => 1.0.0 
    @builder.io/qwik-city: 1.0.0 => 1.0.0 
    undici: 5.22.0 => 5.22.0 
    vite: 4.3.3 => 4.3.3

Additional Information

No response

@ahnpnl ahnpnl added TYPE: bug Something isn't working STATUS-1: needs triage New issue which needs to be triaged labels May 3, 2023
@manucorporat
Copy link
Contributor

Note to self: we need to make sure isBrowser===false during testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants