question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] useServerMount does not run

See original GitHub issue

Qwik Version

0.0.23

Operating System (or Browser)

Linux

Node Version (if applicable)

v16.3.0

Which component is affected?

Qwik Runtime

Expected Behaviour

The callback that is passed to useServerMount is executed.

Actual Behaviour

It doesn’t seem to execute the callback.

Additional Information

Reproduction Steps:

  1. Spin up a new starter with npm init qwik@latest
  2. Use the standard starter (any server, default options)
  3. Add the following code to app.tsx under the state declaration: useServerMount$(() => { console.log("Running server mount"); state.name = "Qwik" });
  4. npm run dev. The console log is never printed and name is still set as ‘World’

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
manucorporatcommented, Jun 8, 2022

We have an internal discussion in the team about this, by default npm run dev is running qwik fully in the browser, no server. So no code runs.

npm run dev.ssr

should do the trick, we might make it the default option soon!

0reactions
manucorporatcommented, Jun 10, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

useResource$ throws error if executed by track-Function #806
I accidentally was using useServerMount$ in my kanban-board-list . Learning Mix and Match useResource$ and useServerMount$ leads into an error.
Read more >
How to Resolve 'Server Service Won't Start' Error in Pro-Watch
This video provides step by step instructions for how to resolve a common 'Windows could not start the Pro-Watch Server service on the...
Read more >
How to Fix Error 1053: The Service Did Not ... - YouTube
How to Fix Error 1053: The Service Did Not Respond to the Start or Control Request in a Timely Fashion.When attempting to start, ......
Read more >
vscode-qwik-snippets - npm Package Health Analysis - Snyk
useServerMount $() function hook: Hook that executes on the component mount when in a server environment. This is useful because server often has...
Read more >
Shai Reznik's Post - qwik #qwiktips - LinkedIn
Today's Qwik Framework tip: Qwik components usually start their execution on the server and then continue on the browser. This means that code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found