chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Allow imports in custom element

Open Simon-Stone opened this issue 6 months ago • 2 comments
trafficstars

Currently, custom elements are only allowed to import from a list of allowed packages. This appears to exclude local packages, as well: When I tried to move some of the code in my CustomElement.jsx to another fileSomeHelperFunction.jsx, I am getting a "Cannot find ./SomeHelperFunction.jsx" in the app. The file is served at localhost:8000/public/elements/SomeHelperFunction.jsx, though.

It would be nice to be able to allow imports from local packages. Without that, everything but trivially complex custom elements quickly become needlessly large and reusing code across multiple custom elements is not possible.

Simon-Stone avatar Apr 25 '25 14:04 Simon-Stone