Comments (3)
Try changing line 17 to {isShowing.value && <ClientOnlyComponent />}
from qwik.
Try changing line 17 to
{isShowing.value && <ClientOnlyComponent />}
Yes, that will work for sure, but I can already work around the issue. The point is that totally valid code causes the runtime to throw an error and quit.
The Stackblitz project is the simplest form I could find that would reproduce the problem. It's not representative of the code I'm actually trying to write (something similar to the Portals example in the docs)
The bit that's interesting is the code was initially using useComputed:
const Comp = useComputed$(() =>
isShowing.value ? ClientOnlyComponent : undefined
)
return(
....
{Comp3.value && <Comp3.value />}
....
)
Which also didn't work, but this did
const Comp = isShowing.value ? ClientOnlyComponent : undefined;
...
{Comp && <Comp />}
which is why I tried contriving what's in the Stackblitz code
const Comp = isShowing.value ? { value: ClientOnlyComponent } : {}
...
{Comp.value && <Comp.value />}
What's the difference between 2 & 3? Why does having Comp stored in an object propety make a difference?
from qwik.
qwik only serializes context that is used during SSR. Are you using useLocation
anywhere during SSR? If not, add it somewhere.
This is a feature to prevent sending useless context data to the client.
If this was the problem, how should the error message have been changed to make this clear to you?
from qwik.
Related Issues (20)
- [🐞] Vite+Qwik JavaScript template preset not working HOT 1
- [🐞] Link component, automatically redirects when you put a URL that doesn't exist HOT 3
- Enhance Qwik CLI to allow migrating automatically from Qwik 1 the Qwik 2 HOT 9
- [✨]Adding visual clue in the docs TOC HOT 16
- [🐞] The tagged function depending on the signal value doesn't make reactive. HOT 2
- [🐞] CSS modules not being linked in the build. HOT 3
- [🐞] Vanilla Node Server Adapter - Cannot find package 'undici' HOT 6
- [🐞] Form's onSubmit and onSubmitCompleted type definition broken HOT 1
- [📖] How to access the current url / path from the root context HOT 3
- [🐞] `qwik-prefetch-service-worker.js` 404 in dev mode HOT 2
- [🐞] `q-bundle-graph-dev....json` 404 in dev mode HOT 3
- [🐞] PrefetchServiceWorker throws `insufficient resources` when navigating while prefetching HOT 7
- [🐞] 404s are thrown when interacting with the page in dev mode with the PrefetchServiceWorker
- [🐞] An unknown symbol is fetched in preview which returns a 404 with the PrefetchServiceWorker HOT 3
- [🐞] Getting "Failed to construct 'URL': Invalid URL" on nx monorepo on dev serve HOT 12
- [🐞] SyntaxError: The requested module `[email protected]` does not provide an export named 'renderToString' HOT 14
- [🐞] image optimizer with imagetools in cloudflare addressed wrong srcset HOT 29
- [🐞] SSG and deploy to Github pages - issue with base urls: service-worker.js etc. HOT 4
- [🐞] `prevUrl` of the `useLocation()` is set even if the first view.
- [🐞] css 404 when vite base set HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qwik.