AnswerDotAI / fasthtml

The fastest way to create an HTML app
https://fastht.ml/
Apache License 2.0
5.05k stars 205 forks source link

ValueError: not enough values to unpack (expected 3, got 0) #321

Closed CrackedResearcher closed 1 month ago

CrackedResearcher commented 1 month ago

when I run my FastHTML app it shows this error dont know how to fix it.

here's the whole error:


    from fasthtml import *
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fasthtml/__init__.py", line 2, in <module>
    from .core import *
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fasthtml/core.py", line 14, in <module>
    from .xtend import *
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fasthtml/xtend.py", line 22, in <module>
    picolink = (Link(rel="stylesheet", href=picocss),
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fasthtml/components.py", line 53, in ft_hx
    return ft_html(tag, *c, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fasthtml/components.py", line 45, in ft_html
    tag,c,kw = ft(tag, *c, **kwargs)
    ^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)```
JonathanRayner commented 1 month ago

You might need to update to the latest version, it looks like that line in components.py that is giving the error changed in this commit https://github.com/AnswerDotAI/fasthtml/commit/170fb7ec3b03e7c2411dbcdf67151d8b9d101121#diff-9c7f3d7dc5f2f135e875dcfaff1efd7e64e94366d47e53f1a6890eed0934cfe1 .

You can see here it currently reads tag,c,kw = ft(tag, *c, attrmap=attrmap, valmap=valmap, **kwargs).list . I think the missing .list is what causes your error probably.

tl;dr does it work if you update to the latest version of fasthtml?

CrackedResearcher commented 1 month ago

yeah I think it got fixed. i uninstalled the package and reinstalled it and it works now thnks!

On Sat, Aug 17, 2024, 09:21 Jonathan Rayner @.***> wrote:

You might need to update to the latest version, it looks like that line in components.py that is giving the error changed in this commit 170fb7e

diff-9c7f3d7dc5f2f135e875dcfaff1efd7e64e94366d47e53f1a6890eed0934cfe1

https://github.com/AnswerDotAI/fasthtml/commit/170fb7ec3b03e7c2411dbcdf67151d8b9d101121#diff-9c7f3d7dc5f2f135e875dcfaff1efd7e64e94366d47e53f1a6890eed0934cfe1 .

You can see here https://github.com/AnswerDotAI/fasthtml/blob/20dce8e8a61cc491dffe460e8777077ec141781d/fasthtml/components.py#L57C5-L57C74 it currently reads tag,c,kw = ft(tag, *c, attrmap=attrmap, valmap=valmap, **kwargs).list . I think the missing .list is what causes your error probably.

— Reply to this email directly, view it on GitHub https://github.com/AnswerDotAI/fasthtml/issues/321#issuecomment-2294611173, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4PI54K66SQYTFJG54TM5NDZR3CFVAVCNFSM6AAAAABMT3LOUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJUGYYTCMJXGM . You are receiving this because you authored the thread.Message ID: @.***>

JonathanRayner commented 1 month ago

Awesome! Glad to hear it's working now.