qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[🐞] serializeQRL: Cannot resolve symbol s_90E3ENLVOAc in null undefined

Open codeyash opened this issue 1 year ago • 8 comments

Which component is affected?

Qwik Optimizer

Describe the bug

This code works perfectly in Dev mode but failing in Prod mode. Tried all types of middlewares like express, Deno etc

const process_text: QRL<(o: any) => string> = $(
  (o: any): string => `${JSON.stringify(o)}  Hello`
);

const e = {      
    filters: ["groups__name=User"],
     process_text: process_text
}

const data = useStore(e)

Reproduction

Above info should be enough

Steps to reproduce

Bun Dev: works perfectly

Bun Preview : As soon this runs and tried to visit the relevant page which use above store, whole server crashes. Without even calling process_text server crashes. Full crash log https://pastebin.com/TNCsRpDW

System Info

System:
    OS: macOS 15.0
    CPU: (12) arm64 Apple M2 Max
    Memory: 1.02 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - /opt/homebrew/opt/node@20/bin/node
    npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm
    pnpm: 9.11.0 - /opt/homebrew/bin/pnpm
    bun: 1.1.6 - ~/.bun/bin/bun
  Browsers:
    Chrome: 129.0.6668.60
    Safari: 18.0
  npmPackages:
    @builder.io/qwik: ^1.9.0 => 1.9.0 
    @builder.io/qwik-city: ^1.9.0 => 1.9.0 
    typescript: 5.4.5 => 5.4.5 
    undici: * => 6.19.8 
    vite: 5.3.5 => 5.3.5

Additional Information

How to debug in prod is missing on docs. I have to debug line by line to find what's the problem. Crash logs are not helpful.

codeyash avatar Oct 02 '24 13:10 codeyash

I solved by moving my code from routeLoader$(index/route) to Task$ inside component.

I still consider it as bug in routeLoader$ which failed to collect all required fn for final build.

codeyash avatar Oct 02 '24 15:10 codeyash

Right this seems to be an issue with the optimizer. Can you please try reproducing in https://qwik.dev/playground? It should also be failing there, since it does production builds.

wmertens avatar Oct 02 '24 15:10 wmertens

I am also getting this error when building:

Cannot resolve symbol s_p321FqRPspM in {
  '6X0KberS7Oc': [ 's_6X0KberS7Oc', 'q-DttXmm6U.js' ],
  QeHqHqnbSiY: [ 's_QeHqHqnbSiY', 'q-AKokdM7B.js' ],
  agzGBGehytw: [ 's_agzGBGehytw', 'q-DvDAJ766.js' ],
  ...
} undefined
worker error: Error: Code(31) https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/core/error/error.ts#L39

lbensaad avatar Oct 03 '24 16:10 lbensaad

@lbensaad that's a different issue and it's likely solved in the upcoming 1.9.1 release

wmertens avatar Oct 03 '24 22:10 wmertens

@wmertens when v 1.9.1 will be released?

lbensaad avatar Oct 04 '24 14:10 lbensaad

The issue still there in v 1.9.1, is there a way to fix it.

lbensaad avatar Oct 08 '24 17:10 lbensaad

@lbensaad Can you make a minimal reproduction?

wmertens avatar Oct 09 '24 07:10 wmertens

The issue has disappeared now, thank you @wmertens.

lbensaad avatar Oct 09 '24 16:10 lbensaad

Strange, I'm getting this error when upgrading from v1.5.7 to 1.11.0 when running a preview build.

serializeQRL: Cannot resolve symbol _hW in null [...source]/src/some-hook.ts
QWIK ERROR Code(31) https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/core/error/error.ts#L39 _hW Error: Code(31) https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/core/error/error.ts#L39
    at createAndLogError (file://[...source]/server/entry.preview.mjs:1458:52)
    at logErrorAndStop (file://[...source]/server/entry.preview.mjs:1451:57)
    at qError (file://[...source]/server/entry.preview.mjs:1478:10)
    at serializeQRL (file://[...source]/server/entry.preview.mjs:5100:11)
    at file://[...source]/server/entry.preview.mjs:5124:42
    at mapJoin (file://[...source]/server/entry.preview.mjs:4827:16)
    at serializeQRLs (file://[...source]/server/entry.preview.mjs:5124:10)
    at renderNode (file://[...source]/server/entry.preview.mjs:2275:52)
    at processData$1 (file://[...source]/server/entry.preview.mjs:2328:16)
    at walkChildren (file://[...source]/server/entry.preview.mjs:2360:12)

EDIT

After some debugging, it seems my preview command used --mode ssr, which isnt used on newer versions of qwik for the preview command, seems that could solve it but will only know for sure once I fix the rest of the issues

DustinJSilk avatar Dec 15 '24 10:12 DustinJSilk

Looking at the comments and the issue seems solved. Thanks.

gioboa avatar Aug 30 '25 19:08 gioboa