whitphx/stlite

ERR_UNSUPPORTED_ESM_URL_SCHEME when using "nodeJsWorker": true in package.json

EnviralDesign opened this issue · 1 comments

I am following the guide here:
https://github.com/whitphx/stlite/blob/main/packages/desktop/README.md

and attempting to create a streamlit desktop application(windows) by building an electron app.

My streamlit app is a simple hello world:

import streamlit as st
if __name__ == '__main__':
    st.header("Hello world")

my package.json looks like this

{
  "name": "efx_dashboard",
  "version": "0.1.0",
  "main": "./build/electron/main.js",
  "scripts": {
    "dump": "dump-stlite-desktop-artifacts",
    "serve": "cross-env NODE_ENV=production electron .",
    "pack": "electron-builder --dir",
    "dist": "electron-builder",
    "postinstall": "electron-builder install-app-deps"
  },
  "build": {
    "files": ["build/**/*"],
    "directories": {
      "buildResources": "assets"
    },
    "win": {
      "target": "portable"
    }
  },
  "devDependencies": {
    "@stlite/desktop": "^0.57.0",
    "cross-env": "^7.0.3",
    "electron": "30.0.8",
    "electron-builder": "^24.13.3"
  },
  "stlite": {
    "desktop": {
      "files": [
        "app.py"
      ],
      "requirementsTxtFiles": ["requirements.txt"],
      "embed": true,
      "nodeJsWorker": true,
      "nodefsMountpoints": {
        "/mnt": "."
      },
      "entrypoint": "app.py"
    }
  }
}

I can run this command fine: npm run dump streamlit_test

However when I try to serve it npm run serve

I get this error:
image

It's specifically related to this bit of the package.json:

"nodeJsWorker": true

If I take that part out, the build/serve process works fine.

Is there anything I'm doing wrong?

This should be fixed in 0.58.1. Thanks!