andfanilo / streamlit-drawable-canvas

Do you like Quick, Draw? Well what if you could train/predict doodles drawn inside Streamlit? Also draws lines, circles and boxes over background images for annotation.
https://drawable-canvas.streamlit.app/
MIT License
544 stars 83 forks source link

TypeError: _lib__WEBPACK_IMPORTED_MODULE_7__.tools[drawingMode] is not a constructor #62

Closed matpz closed 2 years ago

matpz commented 2 years ago

Hi, I'm trying to locally run an application that uses streamlit-drawable-canvas.

I have followed the procedure for the development mode, but once started in place of the drawing component I get the error reported in the title.

I copy below the entire error log:

TypeError: _lib__WEBPACK_IMPORTED_MODULE_7__.tools[drawingMode] is not a constructor (anonymous function) C:/WORK/streamlit-drawable-canvas-develop/streamlit_drawable_canvas/frontend/src/DrawableCanvas.tsx:141

138 | */ 139 | useEffect(() => { 140 | // Update canvas events with selected tool 141 | const selectedTool = new toolsdrawingMode as FabricTool 142 | ^ const cleanupToolEvents = selectedTool.configureCanvas({ 143 | fillColor: fillColor, 144 | strokeWidth: strokeWidth,

Thank you in advance.

matpz commented 2 years ago

Hi @andfanilo, if it can be useful, the problem disappeared by installing the pinned version 0.1.1. Thank you and regards.

andfanilo commented 2 years ago

Awesome, thanks for coming back with the answer! Yeah webpack versions can get pretty picky :/

Have fun developing on the canvas 🎈 Fanilo