QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.86k stars 1.31k forks source link

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

Open codeyash opened 1 month ago

codeyash commented 1 month ago

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 commented 1 month ago

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.

wmertens commented 1 month ago

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.

lbensaad commented 1 month ago

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
wmertens commented 1 month ago

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

lbensaad commented 1 month ago

@wmertens when v 1.9.1 will be released?

lbensaad commented 1 month ago

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

wmertens commented 1 month ago

@lbensaad Can you make a minimal reproduction?

lbensaad commented 1 month ago

The issue has disappeared now, thank you @wmertens.