Skip to content

[🐞] v2 - Computed signal read in prop breaks component #7405

@thejackshelton

Description

@thejackshelton

Which component is affected?

Qwik Runtime

Describe the bug

There is an issue with useComputed$ where in dev mode it works, in production it breaks and affects other components in the app

isolating the issue:

  1. It works in production again after removing this piece of code in checkbox-trigger:
    aria-describedby={
        describedByLabels ? describedByLabels.value : undefined
    }

describedByLabels is a computed

		const describedByLabels = useComputed$(() => {
			const labels = [];
			if (context.description) {
				labels.push(descriptionId);
			}
			if (context.isErrorSig.value) {
				labels.push(errorId);
			}
			return labels.join(" ") || undefined;
		});

Reproduction

https://github.com/thejackshelton/v2-repro-computed/tree/main

Steps to reproduce

Reproduction steps:

  1. pnpm i && pnpm preview
  2. notice that the checkbox does not check or toggle, and there is an error from qwik core in the console

working behavior:

  1. run dev mode
  2. notice that it is toggling in dev mode

System Info

System:
    OS: macOS 15.1
    CPU: (16) arm64 Apple M4 Max
    Memory: 2.26 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.5.0 - /usr/local/bin/npm
    pnpm: 9.5.0 - /usr/local/bin/pnpm
    bun: 1.1.7 - ~/.bun/bin/bun
  Browsers:
    Safari: 18.1
  npmPackages:
    typescript: 5.4.5 => 5.4.5 
    undici: * => 7.4.0 
    vite: 5.3.5 => 5.3.5

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions