Different import name and package name breaks a new app
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Reproduce the generated app using the CLI inputs and commands in the report, then inspect the generated pyproject.toml and the custom_components/frontend/ build output. Check how the differing package_name and import_name are represented in the component declaration; done means the example.py app runs without the asset_dir StreamlitAPIException.
Written by the indexing model from the issue text.
Description
Hello everyone, hope you're doing fine!
I'm trying to generate a new streamlit app with this template, to include my own custom components, and I've found that when the package_name is different than the import_name on the CLI, when running the app it shows the error:
streamlit.errors.StreamlitAPIException: Component 'streamlit-template.custom_components' must be declared in pyproject.toml with asset_dir to use file-backed js.
Here are the steps I've executed on the CLI:
[1/8] author_name (John Smith):
[2/8] author_email (john@example.com):
[3/8] project_name (Streamlit Component X): my streamlit app
[4/8] package_name (my-streamlit-app):
[5/8] import_name (my_streamlit_app): custom_components
[6/8] description (Streamlit component that allows you to do X):
[7/8] Select open_source_license
1 - MIT
2 - BSD-3-Clause
3 - ISC
4 - Apache-2.0
5 - GPL-3.0-or-later
6 - LicenseRef-Proprietary
Choose from [1/2/3/4/5/6] (1):
[8/8] Select framework
1 - React + Typescript
2 - Pure Typescript
Choose from [1/2] (1):
And after having the folders ready I did:
cd my-streamlit-app
uv venv
source .venv/bin/activate
cd ./custom_components/frontend/ && npm i && npm run build
cd ../..
uv pip install -e .
python3 -m streamlit run ./example.py
And faced the error.
I think this has to do with some missing configuration on the template.
Any help to fix the error will be appretiated!
- Dominant language
- Python
- Stars
- 538
- Forks
- 255
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100