SolidJSS
SolidJSโ€ข3y agoโ€ข
17 replies
Bersaelor

How to get `onMount` to be called on the client for a server-rendered site

I've set up a new project using solid-start with solid-start-aws.
Running npm run build creates an index.mjs which I can then use as the lambda-function that creates the static website (with some minor corrections https://github.com/solidjs/solid-start/pull/898 )

Now, when using solid-start for a server rendered website, how do I run initialization code on the client?
I.e. I would like to initialize some third party frameworks on the client.

the following log will never appear on the client:
  onMount(() => {
    console.log("Framework being initialized");
    framework.init('apikey');
  });
Was this page helpful?