QwikDev / QwikDev/qwik

[🐞] Optimizer should find all qrls inside qrls even when only building for client or server

Open
#3,189 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug optimizer
Dominant language
TypeScript
Stars
22.1k
Forks
1.4k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

Which component is affected?

Qwik Runtime

Describe the bug
6:04:20 PM [vite] Internal server error: invoke: qrl $captureRef$ must be defined inside useLexicalScope()
  File: /home/projects/qwik-starter-ydb5i8/src/routes/index.tsx:17:48
      at createError (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:163:17)
      at logError (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:157:54)
      at logErrorAndStop (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:167:17)
      at assertDefined (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:407:15)
      at Proxy.useLexicalScope (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:4991:9)
      at eval (/home/projects/qwik-starter-ydb5i8/src/routes/index.tsx:17:48)
      at invoke (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:1420:26)
      at eval (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:6776:35)
      at async invokeQRL (file://file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik/core.mjs:6795:24)
      at async pureServerFunction (file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik-city/vite/index.cjs:23722:26)
      at async Object.next (file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik-city/vite/index.cjs:23930:9)
      at async runNext (file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik-city/vite/index.cjs:24128:5)
      at async eval (file:///home/projects/qwik-starter-ydb5i8/node_modules/@builder.io/qwik-city/vite/index.cjs:24537:26)
Reproduction

https://stackblitz.com/edit/qwik-starter-ydb5i8?file=src%2Froutes%2Findex.tsx,package.json

Steps to reproduce

No response

System Info
n/a
Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction, especially src/routes/index.tsx and package.json, and reproduce the error in the client-only or server-only build. Trace how the optimizer discovers nested QRLs; the issue is done when all nested QRLs are found and the reproduction no longer raises the useLexicalScope error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.