# Trame in subprocess doesnt render wasm. Possible websocket wslink issue

**URL:** https://discourse.vtk.org/t/trame-in-subprocess-doesnt-render-wasm-possible-websocket-wslink-issue/16087
**Category:** Support
**Tags:** trame, vtkwasm, python
**Created:** [October 8, 2025, 11:11pm UTC](https://discourse.vtk.org/t/trame-in-subprocess-doesnt-render-wasm-possible-websocket-wslink-issue/16087 "2025-10-08T23:11:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Joe\_Tristano](https://discourse.vtk.org/user_avatar/discourse.vtk.org/joe_tristano/32/10300_2.png) [@Joe\_Tristano](https://discourse.vtk.org/u/Joe_Tristano)
#### Post date: [October 8, 2025, 11:11pm UTC](https://discourse.vtk.org/t/trame-in-subprocess-doesnt-render-wasm-possible-websocket-wslink-issue/16087/1 "2025-10-08T23:11:43Z")

</div>

Based on some reading, and this thread [pvd , vtu , vti files with vtk wasm](https://discourse.vtk.org/t/pvd-vtu-vti-files-with-vtk-wasm/16060)

I decided to try and Start trame in a sub process. When I do file open, it starts trame with the appropriate file. When I open a new file, it shuts down the process and starts the server up again. I wanted to use.Pywebview and put trame in an i frame. However, I can’t really do anything with this type of process because I can’t get anything to render on the screen except for the VUEUI. There is no geometry. When I refresh the window, I get some wslink errors. When I start up my app straight from the app script, everything is fine. I really don’t want to pull paraview into my install. I decided to go the separate process route because of possible sync issues with the actors in the mappers in VTK. Wasm. Thouhts @Sebastien_Jourdain

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [October 10, 2025, 3:16pm UTC](https://discourse.vtk.org/t/trame-in-subprocess-doesnt-render-wasm-possible-websocket-wslink-issue/16087/2 "2025-10-10T15:16:07Z")

</div>

I’m not sure to understand what you are exactly doing, but it is definitely possible and all the tools to do that right are available.

---

<div class="post-metadata">

### Author: ![Joe\_Tristano](https://discourse.vtk.org/user_avatar/discourse.vtk.org/joe_tristano/32/10300_2.png) [@Joe\_Tristano](https://discourse.vtk.org/u/Joe_Tristano)
#### Post date: [October 10, 2025, 9:44pm UTC](https://discourse.vtk.org/t/trame-in-subprocess-doesnt-render-wasm-possible-websocket-wslink-issue/16087/3 "2025-10-10T21:44:03Z")

</div>

All part of the file open issue on github. After narrowing the code down to be able to get the process windowed, the file open issue was the eventual blocker. Thanks!

> <https://github.com/Kitware/trame-server/issues/63>
>
> The pywebview window calls aren't returning data from fn
> 
> 
> my code 
> \`\`\`
> # In…stead of directly opening the dialog, send a request to the UI process
> def open\_file\_dialog(self):
> state, ctrl = GLOBAL\_APP.server.state, GLOBAL\_APP.server.controller
> # Send the action to the UI process
> result = ctrl.pywebview\_window\_call(
> "create\_file\_dialog",
> webview.FileDialog.OPEN,
> file\_types = ('PVD Files (\*.pvd)', 'All Files (\*.\*)'),
> allow\_multiple = False
> )
> logging.info(f"File dialog result: {result}")   
> 
> \`\`\`
> 
> result never comes back, should probably be async anyway ... so I cant hook it up to the on\_message on the server or a client state or anything else
> 
> 
> \`\`\`
> # Register a handler for messages from the UI process
> def on\_message(msg):
> # Check for file dialog result
> logging.info(f"Received file dialog result: {msg}")
> if isinstance(msg, dict) and msg.get("action") == "file\_dialog\_result":
> logging.info(f"Received file dialog result: {msg} {dict}")
> result = msg\["result"\]
> # Set the result in the trame state
> app.server.state.file\_to\_open = result
> # ...existing message handling...
> 
> app.server.on\_message = on\_message
> 
> menu = \[
> ("File", \[
> ("Open...", "open\_file\_dialog"),
> \]),
> # ("Help", \[("About", app.show\_about)\]),    
> \]
> def on\_message(msg):
> logging.info(f"Message {msg}")
> if msg == "menu:open\_file\_dialog":
> app.open\_file\_dialog()
> app.server.start(exec\_mode="desktop", 
> maximized=True, 
> menu=menu,
> on\_message=on\_message
> )
> 
> \`\`\`
> 
> Trame code
> \`\`\`
> 
> async def \_monitor\_action\_requests(self):
> while self.\_monitoring:
> await asyncio.sleep(0.5)
> if not self.\_action\_queue.empty():
> msg = self.\_action\_queue.get\_nowait()
> action = msg.get("action")
> args = msg.get("args", \[\])
> kwargs = msg.get("kwargs", {})
> fn = getattr(self.\_main\_window, action)
> if action == "destroy":
> self.exit()
> fn(\*args, \*\*kwargs)
> 
> \`\`\`
> 
> This prevents me from being able to user pywebview menu to do a file-\>open in trame web view. I'd prefer not having to get rust just for file open, if we could have a return queue for pywebview that would help a ton.
