Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS exception due to wrong variable in download function #3173

Closed
123swk123 opened this issue Jun 5, 2024 · 1 comment
Closed

JS exception due to wrong variable in download function #3173

123swk123 opened this issue Jun 5, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@123swk123
Copy link

Description

URL.revokeObjectURL(url);

argument url should be changed to anchor.href

exception details

nicegui.js:363 ReferenceError: url is not defined
    at download (nicegui.js:244:25)
    at download (nicegui.js:348:28)
    at nicegui.js:355:41
    at a.<anonymous> (nicegui.js:361:23)
    at U.emit (index.mjs:136:20)
    at a.value (socket.js:498:20)
    at a.value (socket.js:485:18)
    at a.value (socket.js:455:22)
    at U.emit (index.mjs:136:20)
    at manager.js:204:18
@falkoschindler falkoschindler added the bug Something isn't working label Jun 5, 2024
@falkoschindler falkoschindler added this to the 1.4.27 milestone Jun 5, 2024
@falkoschindler
Copy link
Contributor

Thanks for reporting this issue, @123swk123!

Reproduction (like in this demo):

ui.button('Download', on_click=lambda: ui.download(b'Hello World', 'hello.txt'))

Looks like I introduced this bug during a code review:
9dbf8b9#diff-4e4cc16e68c714c6a8433c24c00c6bc837f4f7ed51259f6e4bff356931927ed0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants