Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
EnviralDesign opened this issue Jun 7, 2024 · 1 comment · Fixed by #959
Closed

Comments

@EnviralDesign
Copy link

EnviralDesign commented Jun 7, 2024

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?

@whitphx
Copy link
Owner

whitphx commented Jun 11, 2024

This should be fixed in 0.58.1. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants