Coder Social home page Coder Social logo

streamlit / component-template Goto Github PK

View Code? Open in Web Editor NEW
385.0 26.0 199.0 2.56 MB

Templates and example code for creating Streamlit Components

Home Page: https://streamlit.io

License: Apache License 2.0

Python 78.47% HTML 3.65% TypeScript 15.35% Dockerfile 2.53%
streamlit

component-template's Introduction

Streamlit Component Templates

This repo contains templates and example code for creating Streamlit Components.

For complete information, please see the Streamlit Components documentation!

Overview

A Streamlit Component is made out of a Python API and a frontend (built using any web tech you prefer).

A Component can be used in any Streamlit app, can pass data between Python and frontend code, and and can optionally be distributed on PyPI for the rest of the world to use.

  • Create a component's API in a single line of Python:
import streamlit.components.v1 as components

# Declare the component:
my_component = components.declare_component("my_component", path="frontend/build")

# Use it:
my_component(greeting="Hello", name="World")
  • Build the component's frontend out of HTML and JavaScript (or TypeScript, or ClojureScript, or whatever you fancy). React is supported, but not required:
class MyComponent extends StreamlitComponentBase {
    public render(): ReactNode {
        // Access arguments from Python via `this.props.args`:
        const greeting = this.props.args["greeting"]
        const name = this.props.args["name"]
        return <div>{greeting}, {name}!</div>
    }
}

Quickstart

  • Ensure you have Python 3.6+, Node.js, and npm installed.
  • Clone this repo.
  • Create a new Python virtual environment for the template:
$ cd template
$ python3 -m venv venv  # create venv
$ . venv/bin/activate   # activate venv
$ pip install streamlit # install streamlit
  • Initialize and run the component template frontend:
$ cd template/my_component/frontend
$ npm install    # Install npm dependencies
$ npm run start  # Start the Webpack dev server
  • From a separate terminal, run the template's Streamlit app:
$ cd template
$ . venv/bin/activate  # activate the venv you created earlier
$ pip install -e . # install template as editable package
$ streamlit run my_component/example.py  # run the example
  • If all goes well, you should see something like this: Quickstart Success
  • Modify the frontend code at my_component/frontend/src/MyComponent.tsx.
  • Modify the Python code at my_component/__init__.py.

Examples

See the template-reactless directory for a template that does not use React.

See the examples directory for examples on working with pandas DataFrames, integrating with third-party libraries, and more.

Community-provided Templates

These templates are provided by the community. If you run into any issues, please file your issues against their repositories.

Contributing

If you want to contribute to this project, ./dev.py script will be helpful for you. For details, run ./dev.py --help.

More Information

component-template's People

Contributors

anoctopus avatar arraydude avatar blackary avatar dependabot[bot] avatar gabrieltempass avatar jrieke avatar kajarenc avatar kantuni avatar kmcgrady avatar lukasmasuch avatar sfc-gh-gpijanski avatar sfc-gh-kbregula avatar sfc-gh-pbelczyk avatar tc87 avatar tconkling avatar vdonato avatar whitphx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

component-template's Issues

Unable to start frontend server for react template

Following the instructions from the videos here - https://docs.streamlit.io/library/components/create
When I try to run the frontend server I run into the error with stacktrace below.

Stack trace:

 npm run start

> [email protected] start
> react-scripts start

(node:30148) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:30148) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...
Failed to compile.

Attempted import error: 'Type' is not exported from 'apache-arrow' (imported as 'Type').
asset static/js/bundle.js 1.64 MiB [emitted] (name: main) 1 related asset
asset index.html 944 bytes [emitted]
asset asset-manifest.json 190 bytes [emitted]
runtime modules 28.2 KiB 13 modules
modules by path ./node_modules/ 1.52 MiB 107 modules
modules by path ./src/*.tsx 8.37 KiB
  ./src/index.tsx 1.62 KiB [built] [code generated]
  ./src/DocComponent.tsx 4.05 KiB [built] [code generated]
  ./src/EntComponent.tsx 2.7 KiB [built] [code generated]

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 83:13-27
export 'Type' (imported as 'Type') was not found in 'apache-arrow' (module has no exports)
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 95:21-31
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 96:22-32
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 97:24-34
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 100:26-36
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 17:0-43
Module not found: Error: Can't resolve './io/adapters' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'adapters.mjs'?
BREAKING CHANGE: The request './io/adapters' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 18:0-42
Module not found: Error: Can't resolve './builder/index' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './builder/index' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 19:0-49
Module not found: Error: Can't resolve './ipc/reader' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'reader.mjs'?
BREAKING CHANGE: The request './ipc/reader' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 20:0-49
Module not found: Error: Can't resolve './ipc/writer' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'writer.mjs'?
BREAKING CHANGE: The request './ipc/writer' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 21:0-51
Module not found: Error: Can't resolve './io/whatwg/iterable' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'iterable.mjs'?
BREAKING CHANGE: The request './io/whatwg/iterable' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 22:0-62
Module not found: Error: Can't resolve './io/whatwg/builder' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'builder.mjs'?
BREAKING CHANGE: The request './io/whatwg/builder' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 23:0-71
Module not found: Error: Can't resolve './io/whatwg/reader' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'reader.mjs'?
BREAKING CHANGE: The request './io/whatwg/reader' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 24:0-71
Module not found: Error: Can't resolve './io/whatwg/writer' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'writer.mjs'?
BREAKING CHANGE: The request './io/whatwg/writer' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 29:0-2592
Module not found: Error: Can't resolve './Arrow' in '/Users/narayan/Documents/dMetrics/Projects/elvis-streamlit-doc/doc_component/frontend/node_modules/streamlit-component-lib/node_modules/apache-arrow'
Did you mean 'Arrow.mjs'?
BREAKING CHANGE: The request './Arrow' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/streamlit-component-lib/dist/ArrowTable.js 17:0-43 83:13-27 95:21-31 96:22-32 97:24-34 100:26-36
 @ ./node_modules/streamlit-component-lib/dist/index.js 18:0-42 18:0-42
 @ ./src/DocComponent.tsx 4:0-90 10:27-49 91:20-43
 @ ./src/index.tsx 6:0-42 9:33-45

9 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.65.0 compiled with 14 errors in 5203 ms

If this is helpful:

node --version
v16.13.1
npm --version
8.3.0

Add children to a custom component

Hello,
First thank you for this amazing project 👍 !
I tried to create a custom component with the ability to add children to the component (text, map, bar_chart...), similar to what can be done using st.columns

What I would like to do for example with this component, is something like:

el1, el2 = my_component(2)
el1.write("this is in element 1")
el2.bar_chart(hist_values)
  • Is it possible using component-template ? Or should it be done in some way with streamlit's DeltaGenerator class or something similar ?

I am quite new to streamlit, so I don't really know where to start and if it is even possible.

Thanks!

Update react-scripts to 5.0.0

Hi. You are currently using React Scripts 4.x.x. This is an old version.

When I update it to 5.x.x I get compile/type errors for Apache Arrow.

Please update react-scripts to 5.0.0.

Npm start crashes

Node.js v18.12.1

Starting the development server...
Error: error:0308010C:digital envelope routines::unsupported
...
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Bi-directional component instructions not working on synced Google Drive on Windows - npm install error

I’m attempting and failing to get the instructions to create create a bi-directional component available here to work using React on Windows.

My setup is as follows:

  • Streamlit 1.31.0
  • nodejs 20.11.0
  • npm 10.2.4
  • Windows 10

Steps I’ve taken:

  1. Cloned this repo
  2. In template/my_component/frontend, run npm install

I get the following error:

npm ERR! code ENOTDIR
npm ERR! syscall mkdir
npm ERR! path G:\Other computers\My Laptop\Documents\Work\Coding\st_component-template_2\template\my_component\frontend\node_modules\babel-jest\node_modules
npm ERR! errno -4052
npm ERR! ENOTDIR: not a directory, mkdir 'G:\Other computers\My Laptop\Documents\Work\Coding\st_component-template_2\template\my_component\frontend\node_modules\babel-jest\node_modules'

npm ERR! A complete log of this run can be found in: C:\Users\phili\AppData\Local\npm-cache\_logs\2024-02-06T20_03_04_381Z-debug-0.log

I’ve posted the log contents here.

Is there a step missing from the instructions? Or have I done something wrong?

Failed to compile

Hello, I'm trying to follow steps to create my own component, but I handle with this issue when I did npm run start.

`Failed to compile.

/home/firmino/projects/component-template/template/my_component/frontend/node_modules/@types/babel__traverse/index.d.ts
TypeScript error in /home/firmino/projects/component-template/template/my_component/frontend/node_modules/@types/babel__traverse/index.d.ts(68,50):
']' expected. TS1005

66 | }
67 | 

68 | export type ArrayKeys = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
| ^
69 |
70 | export class Scope {
71 | constructor(path: NodePath, parentScope?: Scope);`

Node version v12.22.9
npm version 8.5.1

I have to change the template typescript version to 3.8.0, because I was getting error on npm install.

plotly_event conflict with st.plotly_chart(fig, use_container_width=True)

when use both together one more plot with be shown

Like this one two plot appears

fig = px.scatter_mapbox(df, lat="lat", lon="lon", zoom=4, height=800)
fig.update_layout(mapbox_style="open-street-map")


selected_points = plotly_events(fig)

if selected_points:
    st.write(df.iloc[selected_points[0]['pointIndex']].astype(str))

st.write("Total points:", df.shape[0])
st.plotly_chart(fig, use_container_width=True)

Include tests

Hi.

The component template does not include tests. Please add one to verify that running tests works (it doesn't).

Running tests I get errors here:

node_modules/streamlit-component-lib/dist/index.js:17
    export { StreamlitComponentBase, withStreamlitConnection } from "./StreamlitReact";
    ^^^^^^

    SyntaxError: Unexpected token 'export'

Using ts-node.

component in a docker container

How should I write the docker file when using streamlit, which runs a custom component in a docker container?
I created a docker file based on node.js and python, but it doesn't work.
Please help me if you can, please.

Missing script: "export"

Hi, when trying to apply the Prepare your Component step of Publish to PyPi, I get the following error:

$ npm run export
npm ERR! Missing script: "export"

But if I do npm run build, I get the frontend/build/ folder properly created, and then when setting _RELEASE = True I can then use the component without starting the Webpack dev server, as expected.

Is my npm install too old (9.5.1, but note that Development Environment Setup does not specify a minimum version)? Or is the documentation to be updated?

Regards,
Olivier.

An issue happens at npm run start

node version : v16.15.0
npm version : 8.5.5


Command: npm run start
Error message:

Failed to compile.

Type error: JSX element type 'ReactElement<any, any> | Component<{}, any, any> | null' is not a constructor function for JSX elements.
  Type 'Component<{}, any, any>' is not assignable to type 'Element | ElementClass | null'.
    Type 'Component<{}, any, any>' is not assignable to type 'ElementClass'.
      The types returned by 'render()' are incompatible between these types.
        Type 'React.ReactNode' is not assignable to type 'import("/home/chieh/472GB/github/node_modules/@types/react/index").ReactNode'.
          Type '{}' is not assignable to type 'ReactNode'.
            Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props  TS2605

     5 | ReactDOM.render(
     6 |   <React.StrictMode>
  >  7 |     <MyComponent />
       |     ^
     8 |   </React.StrictMode>,
     9 |   document.getElementById("root")
    10 | )

ERROR in /node_modules/streamlit-component-lib/dist/ArrowTable.js

I am encountering an issue when trying to run my Streamlit app and streamlit components. The error message displayed is "ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js".

I have tried uninstalling and reinstalling the streamlit-component-lib package, but the error persists. I have also tried clearing my npm cache and running the app in different environments, but the issue still persists. I have also checked the version of apache-arrow, and it is up to date.

I am not sure what is causing this error and I would appreciate any help in resolving it.

Complete error message:

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 72:13-27
export 'Type' (imported as 'Type') was not found in 'apache-arrow' (module has no exports)

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 82:21-31
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 83:22-32
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 84:24-34
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)

ERROR in ./node_modules/streamlit-component-lib/dist/ArrowTable.js 87:26-36
export 'Table' (imported as 'Table') was not found in 'apache-arrow' (module has no exports)

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 17:0-43
Module not found: Error: Can't resolve './io/adapters' in 'C:\Users\Asus\Documents\testes\greener-sample\scripts\components-test\component-app1\frontend\node_modules\streamlit-component-lib\node_modules\apache-arrow'
Did you mean 'adapters.mjs'?
BREAKING CHANGE: The request './io/adapters' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 18:0-42
Module not found: Error: Can't resolve './builder/index' in 'C:\Users\Asus\Documents\testes\greener-sample\scripts\components-test\component-app1\frontend\node_modules\streamlit-component-lib\node_modules\apache-arrow'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './builder/index' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 19:0-49
Module not found: Error: Can't resolve './ipc/reader' in 'C:\Users\Asus\Documents\testes\greener-sample\scripts\components-test\component-app1\frontend\node_modules\streamlit-component-lib\node_modules\apache-arrow'
Did you mean 'reader.mjs'?
BREAKING CHANGE: The request './ipc/reader' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 20:0-49
Module not found: Error: Can't resolve './ipc/writer' in 'C:\Users\Asus\Documents\testes\greener-sample\scripts\components-test\component-app1\frontend\node_modules\streamlit-component-lib\node_modules\apache-arrow'
Did you mean 'writer.mjs'?
BREAKING CHANGE: The request './ipc/writer' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 21:0-51
Module not found: Error: Can't resolve './io/whatwg/iterable' in 'C:\Users\Asus\Documents\testes\greener-sample\scripts\components-test\component-app1\frontend\node_modules\streamlit-component-lib\node_modules\apache-arrow'
Did you mean 'iterable.mjs'?
BREAKING CHANGE: The request './io/whatwg/iterable' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/streamlit-component-lib/node_modules/apache-arrow/Arrow.dom.mjs 22:0-62
Module not found: Error: Can't resolve './io/whatwg/builder' in 'C:\Users\Asus\Documents\testes\greener-sample\scripts\components-test\component-app1\frontend\node_modules\streamlit-component-lib\node_modules\apache-arrow'
Did you mean 'builder.mjs'?
BREAKING CHANGE: The request './io/whatwg/builder' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.```

Optional tooltip

Regarding this issue, it would be great if this template has the functionality to give a component an optional tooltip just like other Streamlit components with help=.

Quick Start Guide Not Working

Hey guys followed the quick start guide step by step.

In one terminal I did npm i & npm run start
In another I created virtual env, activated it, and then ran streamlit using streamlit run my_component/example.py

I am getting the following error when after going to localhost:8501

File "C:\Users\...\code\test-st-template\my_component\example.py", line 2, 
in <module>
    from my_component import my_component
ModuleNotFoundError: No module named 'my_component'

Am I doing something wrong or is it out of date?

Problem with npm install

I got this error after running "npm install"

`npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

up to date, audited 1825 packages in 23s

92 packages are looking for funding
run npm fund for details

80 vulnerabilities (13 low, 18 moderate, 45 high, 4 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

Run npm audit for details.`

I looked online and couldn't find much information regarding this error. Does anybody know why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.