Skip to content

Conversation

@PikachuEXE
Copy link
Collaborator

@PikachuEXE PikachuEXE commented Sep 23, 2025

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Caused by #8062
Closes #8080

Description

Cannot add anything due to unique ID generation function
Error: illegal invocation
Before #8062

function generateRandomUniqueId() {
  // To avoid importing `crypto` from NodeJS
  return crypto.randomUUID ? crypto.randomUUID() : `id-${Date.now()}-${Math.floor(Math.random() * 10000)}`
}

After

const generateRandomUniqueId = crypto.randomUUID
  ? crypto.randomUUID
  : () => `id-${Date.now()}-${Math.floor(Math.random() * 10000)}`

Copied from ramda/ramda#3439 for why it occurs:

Isn't randomUUID a function?

No, in the browser it is not a free static function, but needs to be bound to crypto

Screenshots

Testing

  • Add any video to any playlist (quick bookmark)
  • Ensure no error and can add

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) September 23, 2025 22:55
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 23, 2025
@FreeTubeBot FreeTubeBot merged commit 9160488 into FreeTubeApp:development Sep 24, 2025
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 24, 2025
PikachuEXE added a commit to NishPatel101/FreeTube that referenced this pull request Sep 25, 2025
* development:
  ! Fix unable to add video to any playlist (FreeTubeApp#8082)
  Translated using Weblate (Polish)
  Translated using Weblate (Basque)
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Sep 30, 2025
* development:
  Translated using Weblate (Turkish)
  Translated using Weblate (English (United Kingdom))
  Bump eslint-plugin-jsdoc from 60.2.0 to 60.5.0 in the eslint group (FreeTubeApp#8091)
  Bump sass from 1.93.1 to 1.93.2 (FreeTubeApp#8090)
  Bump lefthook from 1.13.3 to 1.13.4 (FreeTubeApp#8088)
  Bump electron from 38.1.2 to 38.2.0 (FreeTubeApp#8089)
  Migrate the SearchPage component to the composition API (FreeTubeApp#8086)
  Hide webpack-dev-server error overlay for application errors (FreeTubeApp#8087)
  Translated using Weblate (Icelandic)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Swedish)
  ! Fix unable to add video to any playlist (FreeTubeApp#8082)
  Translated using Weblate (Polish)
  Translated using Weblate (Basque)
  Fix weblate parsing error (FreeTubeApp#8079)
  Bump sass from 1.93.0 to 1.93.1 (FreeTubeApp#8078)
  Bump lefthook from 1.13.1 to 1.13.3 (FreeTubeApp#8077)
  Bump eslint-plugin-jsdoc from 60.1.1 to 60.2.0 in the eslint group (FreeTubeApp#8076)
  Bump shaka-player from 4.16.1 to 4.16.2 (FreeTubeApp#8069)
  Added translation using Weblate (Marathi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unable to create a Playlist or add a video to it

5 participants