Closed moxival closed 1 year ago
Can you provide a piece of code, or even better a stackblitz that reproduces the issue? Without a repo case, i can't prioritize this issue to get it fixed!
@manucorporat I faced similar problem while learning qwik. Here's stackblitz https://stackblitz.com/edit/qwik-starter-xscsrx?file=src/routes/index.tsx
Hey Manu, sorry for my delayed response. I tried several times to reproduce this in stackblitz but i couldn't. Since the error is so obscure I am not sure that i understand exactly what is null and how to make it not null - or how to reproduce it.
Hopefully the stackblitz provided by @bhadreshp5 is the same issue as mine and that will help you debug it.
I can confirm this issue is persistent. It's happening on some complex scenarios when I pass a useStore
as parameter to a function when a click something. I tried to replicated on Stackblitz but it's not easy to reproduce with a simple app.
I can share the logs that I'm getting over the serializeSubscription
.
[vite] Internal server error: must be non null
at createError (file:///Users/sebastian.velasquezg/Documents/code-craft-v2/node_modules/@builder.io/qwik/core.mjs:74:17)
at logError (file:///Users/sebastian.velasquezg/Documents/code-craft-v2/node_modules/@builder.io/qwik/core.mjs:68:54)
at must (file:///Users/sebastian.velasquezg/Documents/code-craft-v2/node_modules/@builder.io/qwik/core.mjs:7828:15)
at serializeSubscription (file:///Users/sebastian.velasquezg/Documents/code-craft-v2/node_modules/@builder.io/qwik/core.mjs:7719:21)
at file:///Users/sebastian.velasquezg/Documents/code-craft-v2/node_modules/@builder.io/qwik/core.mjs:3106:20
at Array.map (<anonymous>)
The error on the screen does not give any clue about the real issue. To me is happening when you pass a state reference created with useStore y replaced with a regular object the error is gone.
+1, It only happens when upgrading from 0.21.0 to 0.22
Looks like it has to do something with conditional chaining and a value is resolved to null or undefined.
I just got this error with my local Qwik/QwikCity build (latest stuff). I traced it to a signal in my JSX.
<img
src={imagePathSignal.value}
alt={`${product.name}`}
class="h-full w-full object-cover object-center transition group-hover:opacity-75"
/>
Switched to this (trimmed the .value
off imagePathSignal.value
), and it works:
<img
src={imagePathSignal}
alt={`${product.name}`}
class="h-full w-full object-cover object-center transition group-hover:opacity-75"
/>
Update:
This happens when I call {imagePathSignal.toString()}
or {String(imagePathSignal)}
in my JSX.
hth
@manucorporat I faced similar problem while learning qwik. Here's stackblitz https://stackblitz.com/edit/qwik-starter-xscsrx?file=src/routes/index.tsx
@manucorporat, Please let us know if there is anything else needed.
Just got the same issue, can't seem to get rid of it... All i did was rename some variables and add another item to initial state. Seems to be some kind of caching issue now
removing any useSignals seems to fix it for me
Which component is affected?
Qwik Runtime
Describe the bug
After upgrading to 0.22.0 Qwik throws
QWIK ERROR Error: must be non null
This is what gets printed
QWIK ERROR Error: must be non null at createError (file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:74:17) at logError (file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:68:54) at must (file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:7831:15) at serializeSubscription (file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:7718:21) at file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:3106:24 at Array.map (<anonymous>) at _pauseFromContexts (file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:3102:14) at beforeClose (file:///[redacted]/node_modules/@builder.io/qwik/server.mjs:515:30) at file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:3608:28 at file:///[redacted]/node_modules/@builder.io/qwik/core.mjs:4087:25 null
When I try to log at serializeSubscription with:
I get
I am testing the still unreleased Image component of gioboa - it might be something wrong with the component but I still believe this error is very strange and does not give any information. I still do not understand what is wrong the component. If I remove the assignment
srcSet={srcSetSignal.value}
the error is no more.Reproduction
none
Steps to reproduce
I have no idea how to reproduce this.
System Info
Additional Information
No response